Results 1 to 2 of 2

Thread: [RESOLVED] Stop escape character.

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    Resolved [RESOLVED] Stop escape character.

    I'm using these 2 functions to convert hex to strings, and string to hex:

    PHP Code:
    function convertASCIIToChr($theContent)
    {
    // http://au.php.net/bin2hex

    if (!is_string($theContent)) return null;
    $r='';
    for (
    $a=0$a<strlen($theContent); $a+=2) { $r.=chr(hexdec($theContent{$a}.$theContent{($a+1)})); }
    return 
    $r;
    }

    function 
    convertChrToASCII($theContent)
    {

    return 
    bin2hex($theContent);

    The problem is that if I convert the following:

    Code:
    <div class="someclass">
    Sometext
    </div>
    I will get this on the other end:

    Code:
    <div class=\"someclass\">
    Sometext
    </div>
    It took me a while to figure out why some of my classes weren't working, but I eventually got it .

    Does anyone know a way around this?

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2005
    Posts
    540

    Re: Stop escape character.

    Don't worry... Figured it out...

    PHP Code:
    echo stripslashes(convertChrToASCII($theContent)); 
    Thanks any way!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width