本文介绍了从print_r()生成XML文件导致php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我在使用print_r()时得到了结果。现在我想分离结果并将其保存到数据库。之前我想用print_r()结果制作一个XML文件。 我的代码:I am getting result when I am using print_r(). Now I want to separate the result and save it to database. And before I want to make a XML file with the print_r() result.My Code:print_r($scrapData); 这给我的输出是:That give me the output is:Array ( [0] => Array ( [company] => 1JANATAMF [lastTrade] => 6.70 [changeAmount] => 0.00 [changePercent] => 0.00% ) [1] => Array ( [company] => 1STICB [lastTrade] => 855.00 [changeAmount] => -5.30 [changePercent] => -0.62% ) [2] => Array ( [company] => 1STPRIMFMF [lastTrade] => 19.90 [changeAmount] => 0.10 [changePercent] => 0.51% ) ...........................[287] => Array ( [company] => ZEALBANGLA [lastTrade] => 8.80 [changeAmount] => 0.40 [changePercent] => 4.76% ) ) 现在,我想从这个结果中创建一个XML文件。之后我想将数据分开保存到MySQL DatatBase。 你能帮我吗。 谢谢。Now, I want to make a XML file from this result. And after than I want to separate the data to save into MySQL DatatBase.Can you help me please.Thank you.推荐答案 给我的输出是:That give me the output is:Array ( [0] => Array ( [company] => 1JANATAMF [lastTrade] => 6.70 [changeAmount] => 0.00 [changePercent] => 0.00% ) [1] => Array ( [company] => 1STICB [lastTrade] => 855.00 [changeAmount] => -5.30 [changePercent] => -0.62% ) [2] => Array ( [company] => 1STPRIMFMF [lastTrade] => 19.90 [changeAmount] => 0.10 [changePercent] => 0.51% ) ...........................[287] => Array ( [company] => ZEALBANGLA [lastTrade] => 8.80 [changeAmount] => 0.40 [changePercent] => 4.76% ) ) 现在,我想从这个结果中创建一个XML文件。之后我想将数据分开保存到MySQL DatatBase。 你能帮我吗。 谢谢。Now, I want to make a XML file from this result. And after than I want to separate the data to save into MySQL DatatBase.Can you help me please.Thank you. 这篇关于从print_r()生成XML文件导致php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-26 15:15