-
strpos
I have this code, but it seems to crap out and not work correctly.
PHP Code:
<?php
$mtext = "What's CSS?";
$menu = "<t|1|Intro to CSS> | <t|2|What's CSS?> | <t|3|CSS Chart>";
echo "<html><body>";
if (strpos($menu, "<t|") == false) {
//it says this = false?
echo "bah!";
} else {
do {
$j = strpos($menu, "<");
if ($j == false) {
break;
}
$k = strpos($menu, ">", $j);
$line = substr($menu, $j + 3, ($k - 1));
echo $line . "<br>";
} while ($j != false);
}
return $text;
?>
any ideas?
-
maybe this is your problem
Quote:
PHP Code:
// in PHP 4.0b3 and newer:
$pos = strpos($mystring, "b");
if ($pos === false) { // note: three equal signs
// not found...
}
from http://www.php.net/manual/en/function.strpos.php
-
Always something so simple.
Thanks, Chris.