php can used to connect mobile phone in the comport ?

Posted on 2009-02-11
Last Modified: 2013-12-13
i find a php script used for connect to the comport, can anyone give the explanation of the code?

also, if i can connect to the comport by php, can i use it to control the mobile to send message? thx


exec('mode COM1: baud=19200 data=8 stop=1 parity=n');   

$fd = dio_open('COM1:', O_RDWR);   

while (1) {   

    $data = dio_read($fd, 1);   

    if ($data) {   

        echo $data;   





Open in new window

Question by:ftpphptest1
    1 Comment
    LVL 4

    Accepted Solution

    This code opens a file named COM1:. It would only open a serial port if you had a device named COM1:, which is likely only going to work on PHP for Windows. It then oddly creates a file handle for read write, and then only reads from the file handle until no more data is available to be read and then closes the file handle.

    It's unlikely that your mobile phone would have a serial interface for sending SMS messages unless it was running Windows Mobile and you wrote the Interface yourself.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now