note 82541 added to function.strstr
| From: | andyatmail310dotcom at osu1 dot php dot net | Date: | Wed, 16 Apr 2008 01:00:01 +0000 |
| Subject: | note 82541 added to function.strstr | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-138344@lists.php.net to get a copy of this message | ||
<?php
$email = 'name@example.com';
$domain = strstr($email, '@');
echo $domain; // prints @example.com
?>
works just fine...
BUT...
<?php
$email = 'name@example.com';
$user = strstr($email, '@', true);
echo $user; // prints name
?>
does not work...
Warning: Wrong parameter count for strstr() in C:\Program Files\Apache Software
Foundation\Apache2.2\htdocs\test.php on line 45
true or TRUE does not make any difference...
1 or 0 makes no difference as well...
this might be a BUG, but i'm not so sure being that it simply does not work...
i'm having to work around it using substr() instead...
----
Server IP: 209.41.74.194
Probable Submitter: 208.57.91.240
----
Manual Page -- http://www.php.net/manual/en/function.strstr.php
Edit -- https://master.php.net/note/edit/82541
Del: integrated -- https://master.php.net/note/delete/82541/integrated
Del: useless -- https://master.php.net/note/delete/82541/useless
Del: bad code -- https://master.php.net/note/delete/82541/bad+code
Del: spam -- https://master.php.net/note/delete/82541/spam
Del: non-english -- https://master.php.net/note/delete/82541/non-english
Del: in docs -- https://master.php.net/note/delete/82541/in+docs
Del: other reasons-- https://master.php.net/note/delete/82541
Reject -- https://master.php.net/note/reject/82541
Search -- https://master.php.net/manage/user-notes.php