SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot txt3rob's Avatar
    Join Date
    Jul 2013
    Location
    Liverpool UK
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    posting string url encoded but need new line

    I have a script which sends a post request to a sms gateway api that requires it to be urlencoded

    when i do the following:

    $message = "Hello \r\n"

    the sms comes out "hello rn"

    would this be a server side issue or would there be another solution?

    i did try using %13%10 but they came out in the sms as well

  2. #2
    SitePoint Evangelist
    Join Date
    Aug 2006
    Location
    Nantwich, Cheshire
    Posts
    413
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Keep in mind that url-encoding uses the two-digit hexadecimal representation, so in your case you would use %0D%0A to represent ASCII 13 and 10 respectively.
    http://www.firenza.net - my homage to a car from the 1970s

  3. #3
    SitePoint Zealot txt3rob's Avatar
    Join Date
    Jul 2013
    Location
    Liverpool UK
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cheers will give this a go


Bookmarks

Posting Permissions

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