LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-06-2007, 04:24 AM   #1
baddah
Member
 
Registered: Feb 2006
Location: Cape Town,South Africa
Distribution: Fedora Core 8
Posts: 188

Rep: Reputation: 30
ETX and STX characters in PHP


Hi,

This is a PHP question,maybe someone in here can help me on this one.

I have a socket server and client running.From my server i send command string to the client which then process these commands.My problem comes when i have send multiple commands to the client which then read them as one command.(One socket_read for multiple socket_sends)

I want to attach STX and ETX characters(ASCII 2 and 3) to each command so that my client that parse the data knows where each commands starts and ends.

My problem is,how do i use these chars.If i wand to send(socket_write) it do i put the characters S,T, and X in the string or is there some predefined char that i can use for STX and ETX?Also,if i socket_read how will it come out on the other side?

Thanks for any help or suggestions
 
Old 12-06-2007, 03:18 PM   #2
krizzz
Member
 
Registered: Oct 2004
Location: NY
Distribution: Slackware
Posts: 200

Rep: Reputation: 30
Use chr() function. In your case chr(2) and chr(3).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
upgraded apache and php now php breaks on ' and special characters ckob Linux - Server 4 10-22-2007 09:28 PM
php regex: escaped characters? Thinking Programming 1 02-09-2006 10:01 AM
execve failed for /etx/x11/x (errno 13) 101proof Linux - Software 1 08-30-2003 04:36 AM
execve failed for /etx/x11/x (errno 13) 101proof Linux - Hardware 1 08-30-2003 04:36 AM
execve failed for /etx/x11/x (errno 13) 101proof Linux - Newbie 0 08-29-2003 09:56 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration