note 109415 added to function.strtok
| From: | gilthans at NOSPAM dot gmail dot com | Date: | Sun, 15 Jul 2012 18:47:49 +0000 |
| Subject: | note 109415 added to function.strtok | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-189146@lists.php.net to get a copy of this message | ||
Note that strtok may receive different tokens each time. Therefore, if, for example, you wish to
extract several words and then the rest of the sentence:
<?php
$text = "13 202 5 This is a long message explaining the error codes.";
$error1 = strtok($text, " "); //13
$error2 = strtok(" "); //202
$error3 = strtok(" "); //5
$error_message = strtok(""); //Notice the different token parameter
echo $error_message; //This is a long message explaining the error codes.
?>
----
Server IP: 69.147.83.197
Probable Submitter: 213.57.180.253
----
Manual Page -- http://www.php.net/manual/en/function.strtok.php
Edit -- https://master.php.net/note/edit/109415
Del: integrated -- https://master.php.net/note/delete/109415/integrated
Del: useless -- https://master.php.net/note/delete/109415/useless
Del: bad code -- https://master.php.net/note/delete/109415/bad+code
Del: spam -- https://master.php.net/note/delete/109415/spam
Del: non-english -- https://master.php.net/note/delete/109415/non-english
Del: in docs -- https://master.php.net/note/delete/109415/in+docs
Del: other reasons-- https://master.php.net/note/delete/109415
Reject -- https://master.php.net/note/reject/109415
Search -- https://master.php.net/manage/user-notes.php