http://vol.stock.hexun.com/charts/Close/Share/Info_3.ashx?code=600111
你想按什么样式写入
simxml 数据读出来后 写入数据库
每一行Item的数据都要写入MYSQL,我刚学PHP,望老师给个代码,谢谢!
$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); //形成一个二维数组。插入库应该难不倒你了吧! 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->attr……
我改了一下,用CURL会更加稳定,非常谢谢你。
[Quote=引用 4 楼 的回复:]
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->attr……
我改了一下,用CURL会更加稳定,非常谢谢你。能否给个代码
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号