Anglais [ˈtəʊkən] US [ˈtoʊkən]

n Symbole ; marque

adj ; symbolique comme garantie de quelque chose en tant que signe

vt.

Fonction php strtok() syntaxe

Fonction : Diviser la chaîne une par une

Syntaxe : strtok(string,split)

Paramètres :

Paramètre Description
string Obligatoire. Spécifie la chaîne à diviser.
splitObligatoire. Spécifie un ou plusieurs caractères de délimitation.

Explication : La fonction strtok() divise une chaîne en chaînes plus petites (jetons).

Fonction php strtok() exemple

<?php
$string = "Hello world. I'm study in php.cn!";
$token = strtok($string, ".");
while ($token !== false)
{    
echo "$token<br>";    
$token = strtok(".");
}
?>

Exécuter l'instance »

Cliquez sur le bouton « Exécuter l'instance » pour afficher l'instance en ligne

Sortie :

Hello world
I'm study in php
cn!