Page 1 of 1

iconv_strpos() - error

Posted: Fri Jul 03, 2009 6:27 am
by bajere
Hi all,

Im looking for some help with this bit of code:

if (iconv_strpos($format, '¤') === 0) {
$position = self::LEFT;
} else if (iconv_strpos($format, '¤') === (iconv_strlen($format) - 1)) {
$position = self::RIGHT;
}

return $position;
}

This is a direct download from the Magento cart site, but when i open it on my site i get and error:

Notice: iconv_strpos() [function.iconv-strpos]: Detected an illegal character in input string in /content/.../.../i.../...co.uk/web/TEST_ENVIRONMENT/masons/lib/Zend/Currency.php on line 139

Im guessing the illegal characters are the square things, can someone tell me what they are meant to be please???

Thanks in advance

Grant

Re: iconv_strpos() - error

Posted: Fri Jul 03, 2009 10:02 am
by Eric!
That's just an ascii symbol for the character 164.

I don't know what special meaning it has. Your application might be using it as a formatting symbol for justification.

Try

Code: Select all

if (iconv_strpos($format, chr(164)) === 0) {
$position = self::LEFT;
} else if (iconv_strpos($format, chr(164)) === (iconv_strlen($format) - 1)) {
$position = self::RIGHT;
}
You probably don't need the type comparison either, so === can be ==

Re: iconv_strpos() - error

Posted: Sat Jul 04, 2009 10:23 am
by bajere
NICE ONE :D

Thanks alot for your help mate. the number didnt work, but the number and dropping one of the = did the job. Im getting time outs now and then, is this a setting i can change, or shall i ring my host?

Cheers

Grant

Re: iconv_strpos() - error

Posted: Sat Jul 04, 2009 1:47 pm
by Eric!
Timeouts with what?

Re: iconv_strpos() - error

Posted: Sun Jul 05, 2009 4:01 am
by bajere
on random pages, as im loading info, sometimes it takes to long and comes up with out of memory error