note 128402 added to function.strtok
| From: | voojj3054 at gmail dot com | Date: | Mon, 17 Apr 2023 20:32:51 +0000 |
| Subject: | note 128402 added to function.strtok | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220357@lists.php.net to get a copy of this message | ||
Hello, portuguese documentation of strtok is wrong, at this part which the example(2) is wrong.
Exemplo #2 Comportamento antigo da strtok()
<?php
$first_token = strtok('/something', '/');
$second_token = strtok('/');
var_dump ($first_token, $second_token);
?>
O exemplo acima produzirá:
string(0) ""
string(9) "something"
(this example above, should be inverted as this:)
Correct:
string(9) "something"
string(0) ""
(exemple 3 is correct)
Exemplo #3 Novo comportamento da strtok()
<?php
$first_token = strtok('/something', '/');
$second_token = strtok('/');
var_dump ($first_token, $second_token);
?>
O exemplo acima produzirá:
string(9) "something"
bool(false)
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.130 (proxied: 170.246.68.240)
----
Manual Page -- https://php.net/manual/en/function.strtok.php
Edit -- https://main.php.net/note/edit/128402
Del: integrated -- https://main.php.net/note/delete/128402/integrated
Del: useless -- https://main.php.net/note/delete/128402/useless
Del: bad code -- https://main.php.net/note/delete/128402/bad+code
Del: spam -- https://main.php.net/note/delete/128402/spam
Del: non-english -- https://main.php.net/note/delete/128402/non-english
Del: in docs -- https://main.php.net/note/delete/128402/in+docs
Del: other reasons-- https://main.php.net/note/delete/128402
Reject -- https://main.php.net/note/reject/128402
Search -- https://main.php.net/manage/user-notes.php