Help in tokenizing a string
| From: | George Lioumis | Date: | Fri, 01 Feb 2002 07:41:13 +0000 |
| Subject: | Help in tokenizing a string | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-16384@lists.php.net to get a copy of this message | ||
Good day to all.
I tried the following code from PHP's manual
if (isset($submit))
{
if ($submit == "Save")
{
echo "$im_file<BR>";
$tok = strtok($im_file, "\\");
while ($tok)
{
echo "$tok<BR>";
$tok = strtok ("\\");
}
}
}
I have the string $im_file ="C:\\<a_path>\\image.jpg" and I want to have
into a variable (say it $im) just the filename part (image.jpg).
The code above, returns me just a "C:" :((
Any suggestions greatly appreciated.