473,395 Members | 1,516 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

removing odd characters after socket_read

Max
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

Aug 28 '06 #1
1 1794
Max
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
Aug 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jacek | last post by:
I have problem with socket_read function. Script connect to telnet and read about hundred lines. Example: $out = socket_read($socket,4096)<------"length =4096" This read only 90 line - why?...
2
by: matt | last post by:
I have an upload script for a photo and a caption. It all goes pear shaped when I upload a character like ' " or / \ | Is there anyway I can parse through the filename when submitting the form and...
8
by: Peter O'Reilly | last post by:
I have an HTML form with a textarea input box. When the user conducts a post request (e.g. clicks the submit button), an HTML preview page is presented to them with the information they have...
1
by: SStewart | last post by:
Does anyone know a good regex expression for removing all special characters from a string, allowing only alphanumeric?
6
by: Niyazi | last post by:
Hi all, What is fastest way removing duplicated value from string array using vb.net? Here is what currently I am doing but the the array contains over 16000 items. And it just do it in 10 or...
3
by: MLH | last post by:
Back in mid-2003, lucason posted a question about removing punctuation chars from a string. Suggested code was posted using Replace function. Could the FN below be easily modified for use with A97...
11
by: ramu | last post by:
Hi, Suppose I have a string like this: "I have a string \"and a inner string\\\" I want to remove space in this string but not in the inner string" In the above string I have to remove...
13
by: Eps | last post by:
Hi there, I believe all strings in .net are unicode by default, I am looking for a way to remove all non ascii characters from a string (or optionally replace them). There is an article on...
4
by: Ahmed, Shakir | last post by:
I need to remove text string from the list of the numbers mentioned below: 080829-7_A 070529-5_c 080824-7_O 070405_6_p The output will be : 080829-7 070529-5
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.