greetings,
i'll start by stating; i am NOT looking for the EXACT syntax to my query but a simple yes or no of its possibility. and if you're feeling generous maybe the php function(s) that i'd use as a jump start. i could use bash but i really want to take a shot at doing this with php. the following output:
Online help is available at
http://reference.wolfram.com/network
MathLM Version: 10.0
MathLM Server: localhost.local
Date: Tuesday, March 22 2016 15:57:04
License Usage Summary:
License Total Total
Program Class in Use Authorized
--------------------------------------------------
Mathematica B 0 2
MathKernel B 0 2
Sub Mathematica B 0 16
Sub MathKernel B 0 16
Licenses in Use:
License
Program Version Class Username Hostname Duration
-------------------------------------------------------------------------------
i need to isolate everything that is between the line of hyphens under the first occurrence of "Program" and the next empty/blank line so i can tinker with how i'm going to process those lines. is there a php function that will do that with relative ease?
thanks in advance.
---------- Post updated 03-23-16 at 10:03 AM ---------- Previous update was 03-22-16 at 01:02 PM ----------
for those looking to accomplish something similar here goes. i scammed the following function online and the above output as $response2. i then used the function and a few other commands to get what i needed:
function get_string_between($string, $start, $end){
$string = ' ' . $string;
$ini = strpos($string, $start);
if ($ini == 0) return '';
$ini += strlen($start);
$len = strpos($string, $end, $ini) - $ini;
return substr($string, $ini, $len);
}
$feature_line = get_string_between($response2, '--------------------------------------------------', 'Licenses');
$feature_line = trim($feature_line);
echo $feature_line;
Mathematica B 0 2
MathKernel B 0 2
Sub Mathematica B 0 16
Sub MathKernel B 0 16
at this point i can used i can probably use preg_split, substr and trim to divide and conquer.