Code: Select all
<p>
<strong>June 26, 1721</strong> Following the recommendation of
Rev. Cotton Mather, Dr. Zabdiel Boylston of Boston completes the first
inoculation against smallpox in the U.S., injecting his own son and two of his
slaves.
</p>
<p>
<strong>1736</strong> In New York, the city almshouse, located on Broadway
near Park Row, opens an infirmary with six beds. This infirmary grows into
Bellevue Hospital.
</p>
<p>
<strong>May 11, 1751</strong> Benjamin Franklin and Dr. Thomas
Bond receive a charter from the Pennsylvania legislature to open the first
hospital in the American colonies for the sick poor and the insane.
</p>
<p>
<strong>1770</strong> Kings College awards the first M.D. degree in the
colonies to Robert Tucker.
</p>
<p>
<strong>June 13, 1771</strong> New York Hospital, the second in
the colonies after the Pennsylvania Hospital, receives a royal charter from
King
</p>
<p>
George III under the name Society of the Hospital in the City of
New York in America, later changed to Society of New York Hospital.
</p>
<p>
<strong>Oct. 12, 1773</strong> The Public Hospital for Persons of
Insane and Disordered Minds is established in Williamsburg, Virginia. It was
the first building in North America devoted solely to the treatment of the
mentally ill.
</p>
<p>
<strong>1791</strong> The Society of New York Hospital opens at a site on Broadway
between Duane and Worth Streets.
</p>
Code: Select all
$dom_doc = new DOMDocument();
$html_file = file_get_contents('HIA.htm');
$dom_doc->loadHTML( $html_file );
$tags_p = $dom_doc->getElementsByTagName('p');
foreach($tags_p as $key=>$tag) {
$tag_value = $tag->nodeValue;
$date = $tag->getAttribute('strong');
$query = "INSERT INTO Milestones(Date, Text) VALUES('$tag_value', '$date')";
mysql_query($query)or die('Value '.$Value.' and Date'.$date. 'could not be inserted. '.myslq_error() );
}
echo "Done";I would like to have the date formatted into the Date field as m/d/Y, and have the Text field with only the text of the historical fact and not the date.June 26, 1721 Following the recommendation of Rev. Cotton Mather, Dr. Zabdiel Boylston of Boston completes the first inoculation against smallpox in the U.S., injecting his own son and two of his slaves.
I appreciate your help in advance.