LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   ETX and STX characters in PHP (https://www.linuxquestions.org/questions/programming-9/etx-and-stx-characters-in-php-604880/)

baddah 12-06-2007 04:24 AM

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

krizzz 12-06-2007 03:18 PM

Use chr() function. In your case chr(2) and chr(3).


All times are GMT -5. The time now is 10:20 AM.