note 53890 added to function.sscanf
| From: | VincentJansen at osu1 dot php dot net | Date: | Thu, 16 Jun 2005 08:04:06 +0000 |
| Subject: | note 53890 added to function.sscanf | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-90517@lists.php.net to get a copy of this message | ||
If you just wants filter out information between two parts of a string, i used the following, it
works better for me then the sscanf function.
<?php
function scanstr($zoekstr,$part1,$part2) {
$firstpos=strpos ($zoekstr, $part1)+strlen($part1);
$lastpos=strpos ($zoekstr, $part2);
$scanresult=substr ($zoekstr, $firstpos, $lastpos-$firstpos);
return($scanresult);
}
echo scanstr
("var1=hello&var2=test&var3=more","var2=","&var3");
?>
----
Manual Page -- http://www.php.net/manual/en/function.sscanf.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+53890
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+53890&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+53890&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+53890&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+53890&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+53890&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+53890&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+53890&report=yes
Search -- http://master.php.net/manage/user-notes.php