Page 1 of 1
not being able to compare if($char=='«')
Posted: Mon Oct 15, 2007 6:36 am
by devendra-m
if($char=='«') is not working properly. $char contain the value '«'.But when i tried the condition it returns false.what might be the problem anybody have idea.
Posted: Mon Oct 15, 2007 6:38 am
by devendra-m
And I used utf-8 as default character set
Posted: Mon Oct 15, 2007 7:21 am
by superdezign
You sure that the character is not html-encoded (i.e. «)?
Posted: Mon Oct 15, 2007 2:39 pm
by Kieran Huggins
try
mb_strrpos() and see if you can find the one string in the other. Keep in mind though that you'll be looking for the offset 0, not a failure (FALSE). Since zero is falsy, you'll need to do a comparison with ===.
Posted: Mon Oct 15, 2007 3:06 pm
by infolock
try this instead then...
Code: Select all
if($char == char(174)) {
echo "YO";
}
Posted: Mon Oct 15, 2007 4:16 pm
by Kieran Huggins
Someone else echos "yo" besides me? AWESOME.
Posted: Mon Oct 15, 2007 7:36 pm
by Benjamin
I usually echo profane 4 letter words that aren't suitable here. Ironically I don't swear in my comments though... generally.
Posted: Mon Oct 15, 2007 9:38 pm
by infolock
=] nice. Yo is almost always what I use when just testing stuff out. That and $bob vars =P
Posted: Tue Oct 16, 2007 12:01 am
by Kieran Huggins
$bob vars too?? Holy hell, it's mirror universe Kieran!
Posted: Tue Oct 16, 2007 12:53 am
by devendra-m
The problem has been solved. Thank you all for your reply.
Posted: Tue Oct 16, 2007 1:42 pm
by d3ad1ysp0rk
astions wrote:I usually echo profane 4 letter words that aren't suitable here. Ironically I don't swear in my comments though... generally.
I've moved away from that and more towards generic words such as "Test" and "ABC". Every user of my site now refers to me as Mr. OMGLOL, being as I threw a die into some code that just happened to be sunk over to our live site by a programmer who didn't think anyone else was working at the time. Ah, good times.

Posted: Tue Oct 16, 2007 4:58 pm
by superdezign
I always echo "okay," "not okay," and "shazbot!" Depends on whether or not something was supposed to happen.
Posted: Wed Oct 17, 2007 8:53 am
by Weirdan
I prefer var_dump(__FILE__ . ':' . __LINE__, $valueToDump)