src/PTel.php
public function send($data, $newline = true) {
        if (!$this->_sock) { throw new SocketClientException("Connection unexpectedly closed!"); }
        if ($newline) { $data = $data.$this->retcarriage; }
        if (! $wr = fwrite($this->_sock, $data)) {
            throw new SocketClientException('Error while sending data!');
        }
        return $wr;
    }
public function send($data, $newline = true) {
        if (!$this->_sock) { throw new SocketClientException("Connection unexpectedly closed!"); }
        if ($newline) { $data = $data.$this->retcarriage; }
        if (! $wr = fwrite($this->_sock, $data)) {
            throw new SocketClientException('Error while sending data!');
        }
        return $wr;
    }
public function send ( $ data , $ newline = true ) { if ( ! $ this -> _sock ) { throw new SocketClientException ( "Connection unexpectedly closed!" ) ; } if ( $ newline ) { $ data = $ data . $ this -> retcarriage ; } if ( ! $ wr = fwrite ( $ this -> _sock , $ data ) ) { throw new SocketClientException ( 'Error while sending data!' ) ; } return $ wr ; }
Send data to socket

@param   $data       mixed   Can be anything: string, int, hex, binary
@param   $newline    bool    Determines send or not carriage return

@throws  SocketClientException   On socket communication error

@return  int   Bytes written
Send data to socket