how to get telnet output via php

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
johnj
php-forum Super User
php-forum Super User
Posts: 1803
Joined: Thu Mar 10, 2011 5:07 pm

Wed Apr 24, 2013 7:07 am

The second parameter of stream_get_line() is the length of bytes tobe read. Please increase that, or use a while loop and read till the end of the stream.

johnj
php-forum Super User
php-forum Super User
Posts: 1803
Joined: Thu Mar 10, 2011 5:07 pm

Thu Apr 25, 2013 7:38 pm

Something like this,

Code: Select all

<?php
while (!feof($handle)) { 
    $line = stream_get_line($handle, 1000000, "\n"); 
} 
?>

Post Reply