Well I was going along smoothly from this morning....but it came down to
having to change the field type to date in the mySQL..so now I have this
which returns a scraped value formatted like this 0/00/00 m/d/y
$inDate = $results[3][$i];
Which date function can I use to format for the db so that I will be able to
use range references...there are so many get_date, date_modify....I'm
lost...
My full code is this:
preg_match_all('/<p><font size="2" face="Arial, Helvetica,
sans-serif">(.+)<br>(.+)<br>.+(\d+\/\d+\/\d+)\s(.+)<br>(.+)<br>.+Critical
Violations Found:.+(\d+)(.+)Noncritical Violations Found:.+(\d+)/imsSU',
utf8_encode($url), $results);
for ($i=0; $i < count($results[0]); $i++)
{
$name1 = strtolower($results[1][$i]);
$name =
ltrim($name1);
$address = strtolower($results[2][$i]);
$inDate
= $results[3][$i];
$inType = $results[4][$i];
$notes =
trim($results[5][$i]);
$critical = trim($results[6][$i]);
$cviolations = $results[7][$i];
$noncritical = $results[8][$i];
//trying to manipulate different field data
$cleanViolations =
str_replace('*', '', $cviolations);
$ucName = ucwords($name);
$ucAddress = ucwords($address);
$mysql_name =
mysql_escape_string($ucName);
$mysql_address =
mysql_escape_string($ucAddress);
$mysql_inDate =
mysql_escape_string($inDate);
$mysql_inType =
mysql_escape_string($inType);
$mysql_notes =
mysql_escape_string($notes);
$mysql_critical =
mysql_escape_string($critical);
$mysql_cviolations =
mysql_escape_string($cleanViolations);
$mysql_noncritical =
mysql_escape_string($noncritical);
echo "$ucName <br>";
echo "$ucAddress <br>";
echo "$inDate <br>";
echo "$inType
<br>";
echo "$notes <br>";
echo "$critical <br>";
//echo "$cviolations <br>";
echo "$cleanViolations <br>";
echo "$noncritical <br><hr>";
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php