Click here to get back home

PhP character comparison problem...

 HomeNewsGroups | Search | About
 comp.lang.php    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
PhP character comparison problem... Mandragon03 07-10-2008
Get Chitika Premium
Posted by Mandragon03 on July 10, 2008, 6:23 pm
Please log in for more thread options
I am trying to strip the =BF and =A1 from some Spanish phrases in my
database. I pull the query data from the MySql database (using PhP)
and I know it is returning the correct rows because I have verified
it by printing it out in Firefox.

When I try this:

if( substr($PhrasesRow[0], 0, 1) =3D=3D "=BF" || substr($PhrasesRow[0], 0,
1) =3D=3D "=A1" )

or

if( mb_substr($PhrasesString[0], 0, 1) =3D=3D "=BF" || mb_
substr($PhrasesString[0], 0, 1) =3D=3D "=A1" )

it never makes it into the 'if' block even though I have verified
there are phrases that meet this criteria.

Does anyone have a suggestion on how to get it to recognize that these
phrases start with '=BF' or '=A1' ?

Thanks for your ideas,

Mandragon

Posted by NC on July 11, 2008, 4:46 pm
Please log in for more thread options
On Jul 10, 3:23 pm, Mandrago...@gmail.com wrote:
>
> I am trying to strip the =BF and =A1 from some Spanish phrases
> in my database.

And in what encoding is the Spanish text stored in the database?
Additionally, are you sure that "=BF" and "=A1" are stored as such, rather
than, say, "¿" and "¡"?

Cheers,
NC

Posted by macca on July 13, 2008, 10:41 am
Please log in for more thread options
On Jul 10, 11:23=A0pm, Mandrago...@gmail.com wrote:
> I am trying to strip the =BF and =A1 from some Spanish phrases in my
> database.


$find =3D array('=BF','=A1','¿',;¡');

$PhrasesString =3D str_replace($find,'',$PhrasesString);

Similar ThreadsPosted
String comparison problem... March 20, 2005, 4:49 pm
Re: Odd String Comparison Problem March 15, 2008, 9:32 am
PhP, Access/SQL, Date comparison problem. (I'm new to PhP) August 28, 2004, 1:52 pm
Character Problem... March 8, 2005, 3:01 am
"Special Character" Problem with DOM January 29, 2007, 7:15 pm
Problem with RewriteRule when url contains percent character February 4, 2007, 4:49 pm
PHP and MSSQL character encoding problem. July 14, 2008, 9:39 am
character encoding problem - =?iso-8859-1?b?ow==?= (pound) sign October 27, 2005, 8:54 am
Japanese character problem in mail subject line May 31, 2007, 3:01 am
Database Comparison? September 14, 2004, 5:04 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap