substr - why won't this work?
Posted: Tue May 11, 2010 4:49 am
$row->title is "BIGDOG" for this example.
For some reason I have to state -4 to get three characters.
It does render DOG if I echo $word, but it will NOT produce the "this should show here" text.
Anyone know why?
Code: Select all
$word = substr("$row->title", -4);
if ($word== "DOG")
{ echo "this should show here";}It does render DOG if I echo $word, but it will NOT produce the "this should show here" text.
Anyone know why?