note 11642 added to strpos
| From: | goto at recyclebroker dot com | Date: | Wed, 28 Feb 2001 21:16:28 +0000 |
| Subject: | note 11642 added to strpos | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-11670@lists.php.net to get a copy of this message | ||
-----input 101098,Affgfd yy hfgyhj---
$input="101098,Affgfd yy hfgyhj";
$ct=(integer)strpos($input,",");
print "<p>input str is <b>".$input."</b> pos na , is
<b>".(string)$ct."</b></p>";
$pos_name=substr($input,strpos($input,",")+1);
$pos_id=substr($input,strpos($input,$sep),strlen($input)-strlen($pos_name)-1);
print "pos_id ".$pos_id." pos name ".$pos_name;
----output----
input str is 101098,Affgfd yy hfgyhj pos na , is 6
pos_id 101098 pos name Affgfd yy hfgyhj
http://www.php.net/manual/en/function.strpos.php