<?php
$db_values=array();
$filename=$argv[1];
// echo "$filename path <br><br>";
$vm_prop=file($filename);
foreach($vm_prop as $key=>$value) {
//echo" $key => $value<br>";
$db_values[]=$value;
}
print_r($db_values);
function clean($var) {
$var=stristr($var, '=');
$var=str_replace ("=" ,"",$var);
echo "\n";
return $var;
}
echo clean($db_values[10]);
echo clean($db_values[11]);
echo clean($db_values[12]);
?>
php db_bk.php /var/spool/asterisk/voicemail/default/101/INBOX/msg0002.txt
domingo, 18 de junio de 2017
viernes, 9 de junio de 2017
listing files inside txt file inside a directoy and reading its content
<?php
foreach (glob("/var/spool/asterisk/voicemail/device/$_GET[vm]/INBOX/*.txt") as $filename) {
echo "$filename path <br><br>";
$vm_prop=file($filename);
foreach($vm_prop as $key=>$value) {
echo" $key => $value<br>";
}
}
?>
foreach (glob("/var/spool/asterisk/voicemail/device/$_GET[vm]/INBOX/*.txt") as $filename) {
echo "$filename path <br><br>";
$vm_prop=file($filename);
foreach($vm_prop as $key=>$value) {
echo" $key => $value<br>";
}
}
?>
Suscribirse a:
Entradas (Atom)