removing odd characters after socket_read

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Max

    #1

    removing odd characters after socket_read

    I'm having a major issue in which I am reading data from a telnet
    server with socket_read, and the data apears to be coming back with
    what seems like either line feeds that stay on the same line or
    left-arrow characters. I can't really figure out what is coming back,
    so I'm not sure how to parse it out. If I simply dispay it on a web
    page, it works, but if I try to feed it through an ajax call, it prints
    the first line, then stops. I'm sure this is because it line feeds on
    the same line or something. Also, I cannot do proper regex matching on
    the lines as well.

    Is there anything in PHP that can clean up these lines? Or would I have
    to build a preg_match statement and only allow letters and punctuation?

    Thanks,
    Max

  • Max

    #2
    Re: removing odd characters after socket_read

    Well I may have solved the problem myself. A simple trim seemed to
    clear it up as all the strange characters seem to be at the beginning
    of the string.

    Max

    Max wrote:
    I'm having a major issue in which I am reading data from a telnet
    server with socket_read, and the data apears to be coming back with
    what seems like either line feeds that stay on the same line or
    left-arrow characters. I can't really figure out what is coming back,
    so I'm not sure how to parse it out. If I simply dispay it on a web
    page, it works, but if I try to feed it through an ajax call, it prints
    the first line, then stops. I'm sure this is because it line feeds on
    the same line or something. Also, I cannot do proper regex matching on
    the lines as well.
    >
    Is there anything in PHP that can clean up these lines? Or would I have
    to build a preg_match statement and only allow letters and punctuation?
    >
    Thanks,
    Max

    Comment

    Working...