Re: Unable to get strpos() to work correctly in class method - more.... SOLVED

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/26/2015 2:22 PM, Christoph Becker wrote:
> JEofVA wrote:
>
>> I just noticed something weird in the debug information that I am
>> getting from this program that probably has something to do with my
>> problem, but I don't quite know what to make if it.  Perhaps someone can
>> clue me into what is going on.
>>
>> When the 'extract_quotes($string)' method is called the $string it is
>> passed comes from another variable that holds the cleaned contents of a
>> text input.  I didn't notice before but as I looked at the string using
>> var_dump(), immediately after it has gotten passed into the method, I
>> get an anomalous report.  Below is what I get:
>>
>>   string(57) ""some phrase" single "another phrase""
>>
>>
>> The outermost quotes excluded, I count 37 characters in the string.  Why
>> are 57 being reported?  Could the miscount be an indicator of why the
>> method doesn't recognize any of the quotes?
> Well, if this var_dump() output is displayed on a webpage, you should
> have a look at the HTML source code.  I can easily imagine that the
> string is actually:
>
>   '"some phrase" single "another phrase"'
>
> This has a length of 57 bytes, and would explain why your method doesn't
> recognize the quotes.
>
Boy, do I feel stupid. This is almost as bad as the time I ....  well,
never mind! 

You are absolutely right.  That is my problem, and was easily fixed with
html_entity_decode(). Thanks so much!!!


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux