From f050fd9b83e78063a964a5aef9d44284e7c13b8a Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Sun, 8 May 2005 08:43:35 +0000 Subject: [PATCH] explain the === problem and clarify the 1st example. cleaning user notes.. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@186006 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/strings/functions/strtok.xml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/reference/strings/functions/strtok.xml b/reference/strings/functions/strtok.xml index dcfe7b3118..2f6045eceb 100644 --- a/reference/strings/functions/strtok.xml +++ b/reference/strings/functions/strtok.xml @@ -1,5 +1,5 @@ - + @@ -28,7 +28,8 @@ $string = "This is\tan example\nstring"; /* Use tab and newline as tokenizing characters as well */ $tok = strtok($string, " \n\t"); -while ($tok) { + +while ($tok !== false) { echo "Word=$tok
"; $tok = strtok(" \n\t"); } @@ -94,10 +95,7 @@ var_dump($first_token, $second_token); - - Also be careful that your tokens may be equal to "0". This - evaluates to &false; in conditional expressions. - + &return.falseproblem; See also split and explode.