If you like to use OSC you can use the OSC.php script that you can download from http://andy.schmeder.net/freesoftware (you can access this also from http://opensoundcontrol.org/ website).
If you don’t like to use OSC you can find in the script OSC.php the function OSCClient, that use UDP socket.
You can use this function to send unformatted message to Max.
For max side I use java object [mxj net.udp.recv], in my experience it work very fine.