Oh, I see. You will get it...this is where we all start with php. You should look at W3schools or tiztag for tutorials.
I wrote something real quick for your AT commands but not sure how exactly it would work for you. But should give you some Idea
Code:
<?php
$contents = file_get_contents("at.php");
$arrays = explode('+CT:', $contents);
print_r($arrays)."<hr />";
//mysql_query($connect);
foreach($arrays as $value){
$i = 0;
print_r($value)."<hr />";
for($i=0; $i < count($value); $i++) {
$new = explode(',',$value);
echo $new[1]. "|" .$new[2]."|".$new[3]."|".$new[4]."|".$new[5]."<br />";
//$sql = "INSERT INTO modem2 (CT,STATUS,FROM,TIME,MESSAGE) VALUES (' ',".$new[1].",".$new[2].","$new[3].")";
}
}
?>