iconv_strpos() - error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bajere
Forum Newbie
Posts: 20
Joined: Fri Jul 03, 2009 6:20 am

iconv_strpos() - error

Post 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
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: iconv_strpos() - error

Post 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 ==
bajere
Forum Newbie
Posts: 20
Joined: Fri Jul 03, 2009 6:20 am

Re: iconv_strpos() - error

Post 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
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: iconv_strpos() - error

Post by Eric! »

Timeouts with what?
bajere
Forum Newbie
Posts: 20
Joined: Fri Jul 03, 2009 6:20 am

Re: iconv_strpos() - error

Post by bajere »

on random pages, as im loading info, sometimes it takes to long and comes up with out of memory error
Post Reply