Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 29th, 2012  |  syntax: None  |  size: 0.45 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Trying to determine if a stream is active php
  2. $fp = fsockopen("82.35.172.112:88/broadwave.m3u?src=1&;rate=1", 88, $errno, $errstr, 30);
  3. if (!$fp) {
  4. echo "$errstr ($errno)<br />n";;
  5. }else{
  6. echo "stream is there";
  7.  
  8. }
  9. fclose($fp);
  10.        
  11. <?php
  12.  
  13.     ini_set('default_socket_timeout', 1);
  14.  
  15.     if(!$fp = @fopen("http://86.28.144.85:88/broadwave.m3u?src=1&rate=1", "r")) {
  16.         echo "no stream";
  17.     } else {
  18.         echo "streaming";
  19.         fclose($fp);
  20.     }
  21.  
  22. ?>