I've been working this script for the past 9 hours ... so I'm a little fried ... can anyone tell me why the $ok variable echos as 10? Here's the value of the $STR I'm using ... I don't get it and ... I'm fried. It's supposed to be trying to fix an ugly DHTML error that's cost me the entire day, and the whole thing is done except for this one last stupid bug ... any ideas? Thanks in advance.
$str = 'src="5544hgei3y+54854954205+736]2006\548765\234\12345\342" align=left border="1"';
// Fix Alignment
$seeker = strpos($str,'align=');
if ($seeker !== false) {
$seeker = strpos($str,'align="');
if ($seeker !== true) {
$amark_one = strpos($str,'align=')+6;
$firstpart = substr($str,0, $amark_one);
echo 'Mark1: '.$amark_one . '<br>';
$amark_two = strpos($str,' ', $amark_one);
if (($amark_two === false)) {
$amark_two = strpos($str,'>', $amark_one);
}
echo 'Mark2: '.$amark_two.'<br>';
$secondpart = substr($str, $amark_two);
// echo 'Part2: '.$secondpart.'<br>';
// echo 'alignLength: '.$align_length.'<br>';
$str = $firstpart.'"'.substr($str, $amark_one, $amark_two-$amark_one).'"'.$secondpart;
if ($amark_two - $amark_one = 4) $align = 'left';
if ($amark_two - $amark_one = 5) $align = 'right';
if ($amark_two - $amark_one = 6) $align = 'center';
$ok = $amark_one+4;
echo $ok;
}
}