Brother, I want to write this kind of XML data into a MYSQL database with PHP. How to write it?

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!

Brother, I want to write this kind of XML data into a MYSQL database with PHP. How to write it?

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!

Brother, I want to write this kind of XML data into a MYSQL database with PHP. How to write it?

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[[email protected]’]; }print_r($ar); //Form a two-dimensional array. Inserting the library should not be difficult for you!

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: 34331943@QQ.com

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索