php - Looping url from DB for simplexml_load_file -


i need looping xml url simplexml_load_file in php.

i don't understand because if write url variable, script work, if load url database script die.

this code work:

$xml = simplexml_load_file("www.blablabla.com/file.xml") or die("error: cannot create object");                            /*other script, elaborate response*/ 

and code work:

$url = "www.blablabla.com/file.xml"; $xml = simplexml_load_file($url) or die("error: cannot create object");                           /*other script, elaborate response*/ 

now, load url database, , pass value simplexml_load_file.

$query = $mysqli->query("select url wp_rezdy_products"); while($result = $query->fetch_row()){ $url = $result[0]; echo $url ."<br>";  $xml = simplexml_load_file($url) or die("error: cannot create object"); */ other script, elaborate response */ } 

why method doesn't work , die method message error?

the echo ok, return value of url, why simplexml_load_file no?


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -