I want PHP to write this kind of XML data into a MYSQL database. How to write it?
http://vol.stock.hexun.com/charts/Close/Share/Info_3.ashx?code=600111
—— Solution——————–
- PHP code
$con=file_get_contents("http://vol.stock.hexun.com/charts/Close/Share/Info_3.ashx?code=600111");
$xml = simplexml_load_string($con);
foreach($xml->Item as $v){
$arr=(array)$v->attributes();
$ar[]=$arr['@attributes'];}
print_r($ar); //Form a two-dimensional array. Inserting the library should not be difficult for you!