Skip to content

Instantly share code, notes, and snippets.

@johnabela
Created December 3, 2017 02:27
Show Gist options
  • Save johnabela/040ab3f827cef8e4ff4f53a4b0b52cde to your computer and use it in GitHub Desktop.
Save johnabela/040ab3f827cef8e4ff4f53a4b0b52cde to your computer and use it in GitHub Desktop.
Acquire the stream path of a .pls file
//
//
///////////////////////////////////////////////////////////////////////
// pls_GetStreamPath()
//
// - Description:
// Acquire the stream path of a .pls file
//
// - Usage:
// $streamPath = pls_GetStreamPath($uri);
//
// - Author:
// John B. Abela <abela@4cm.com>
//
// - History:
// 12/2/2017 6:25 PM - Created
///////////////////////////////////////////////////////////////////////
function pls_GetStreamPath($uri) {
//
$file = new SplFileObject($uri);
//
while (!$file->eof()) {
//
if ( substr($file->fgets(), 0, strlen('File1=') ) === 'File1=') {
//
return trim(str_replace('File1=','',$file->fgets()));
break;
//
}
//
}
//
$file = null;
//
}
//
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment