Ok, you are learning PHP, an extremely useful language... It is C/C++ for the web
This:
Code:
include( '../lm_settings.php' );
is correct. That way you include the contents of lm_settings.php into your file, parameters and functions alike. This:
Code:
<?php
ob_start();
include('http://MYDOMAIN.com/LMFOLDER/lm.php?cmd=lists&pwd='.$admin_password);
$myStr = ob_get_contents();
ob_end_clean();
echo 'List Name - Number of Subscribers - Date and Time';
echo "<br/>";
echo $myStr;
?>
is correct as well. Note that you can also write include( "http://MYDOMAIN.com/LMFOLDER/lm.php?cmd=lists&pwd=$admin_password"); that is, inserting the parameter directly into the string. Same effect. The output:
List Name - Number of Subscribers - Date and Time
List1 502 2015-04-23 23:23:50
is a tab delimited list of lists with one record per line. List name is in the first column and address count in the second column. I wrote a little function to extract data from delimited strings. It is called nthfield:
Code:
// Get the field number fieldnumber from $text for the given $delimiter
function nthfield($text, $delimiter, $fieldnumber) {
$data = explode($delimiter, $text);
return $data[$fieldnumber-1];
}
To extract the address count of your list, since you only have one, you can do:
Code:
$count = nthfield( $myStr, "\t", 2 );