I need to pass messages to my C program from PHP and I am doing this via message queues.
I have the message queues working and both sides can receive messages.
The problem is on the php side formatting the data. I am trying to send C style string, but php handles strings much differently. How would I convert the php string into a null temrinated C string?
Basically I need 'config1' to be the null terminated string.
msg_send($mq_id, $MSG_CHANGECONFIG, 'config1', true, false, $error);
It appears php stores strings like so: \"s:8:\\"config1\000\\"; where \ are just escapes.
Is there any way to do this, or a different way to parse this from the C side in order to convert it to a C string?