Jump to content

Problem with dagger and double dagger in a string.


frost

Recommended Posts

Hi,

 

I am having some trouble and I hope it is somthing obvious I have just missed:

 

I have a string that contains dagger and double dagger characters, here is a sample:

 

17‡48‡97‡3820‡FREE†

 

I am trying to run a str_replace on them as I understand they are bad characters to use - http://www.cs.tut.fi/~jkorpela/www/windows-chars.html

 

I have tried all kinds of things with no luck, changing the charset, trying to replace chr(134) chr(135) etc etc.

 

Any help would be apprectiated.

 

Cheers!

The problem is that this is coming from a private XML feed that I can't share.

 

When I copy/paste some of the code to work on it seems to work just fine. For example:

 

<?

$str = "17‡48‡97‡3820‡FREE†";

 

$str = str_replace(chr(134), '**', $str);  // dagger (a second footnote)

$str = str_replace(chr(135), '***', $str);  // double dagger (a third footnote)

 

echo $str;

?>

 

This works!

 

But when I do this:

 

<?

$str = $pPGA_response;

 

$str = str_replace(chr(134), '**', $str);  // dagger (a second footnote)

$str = str_replace(chr(135), '***', $str);  // double dagger (a third footnote)

 

echo $str;

?>

 

It spits it out with the daggers intact.

 

 

 

This is just a whim, but try 84/85 in that script, and see if it works.

 

 

If not, can you upload the part of the XML feed?  Or you could just do what I'm going to do and open it in a hex editor and see what values are at the dagger/double dagger.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.