Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Location
    Los Angeles
    Posts
    545
    Thanks
    81
    Thanked 5 Times in 5 Posts

    Strip \u000d\u000a ?

    I'm translating a string from english to spanish. I'm using the MS Bing translator. When the translated text is returned, I write it to a file and when I open the file up in my editor I see these characters: "\u000d\u000a" between lines of text.

    I know those are unicode chars but how do I convert them to regular \r\n chars?

    The following code doesn't work:

    PHP Code:
    $test=str_replace("u000d"""$s); 
    Thanks...
    RalphF
    Business Text Messaging Services
    https://www.MobileTextingService.com

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,084
    Thanks
    23
    Thanked 593 Times in 592 Posts
    $test=str_replace("\u000d\u000a", "\r\n", $s);

  • Users who have thanked sunfighter for this post:

    rfresh (09-03-2011)


  •  

    Posting Permissions

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