SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Apr 2009
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    cURL, str_replace and textarea

    Hello there,

    I am having a headachingly but a relatively simple problem which i cannot solve. I am using cURL to gather html code from a given URL.

    In one window, I am placing the code in a textarea and after submitting the form with the textarea in it (without making any changes) I put the code into a file.

    In another window, I am cURL'ing the data straight to the file.

    Though, the amount of characters is different.
    Through textarea: 103,055
    Without textarea: 100,825

    How can this be? I've tried str_replace function to remove \n or \r or \t characters or trim() the second file, but it resulted, of course, in even less characters.

    The problem is, the system is much more difficult than this, but this part is not changed. I need the second file (without textarea) to be exactly, byte to byte, the same as the first one, without using textarea. How can I achieve this?

    Thank you in advance.

    forgot to mention that I am using $html = htmlentities($htmlcode, ENT_QUOTES, 'UTF-8', true); and I am displaying the $html variable in the textarea. But after the form has been submitted, I check the code and it is decoded, but maybe textarea displays the code somewhat different than it would be just cURL'ing. And then after submission the character count gets different or something. I don't really know.
    Last edited by donkapone; Apr 25, 2009 at 07:16. Reason: forgot to mention htmlentities()


Tags for this Thread

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
  •