View Single Post
Old 06-17-2002, 08:27 AM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,489
sde is on a distinguished road
hmm .. there's probably xml feeds on that stuff .. ya think?

with the ecommerce stuff, i'm using the following method to extract xml data into variables.

<?
$string="<somexml>somethinghere</somexml><temperature>72</temperature>";

$startpos = strpos($string, "<temperature>");
$endpos = strpos($string, "</temperature>");
$temperature = substr($string, $startpos, $endpos - $startpos);

echo "The current temperature is: $temperature";

?>

now the variable $temperature = 72;

you probably already knew that, but i just learned it last week. do you know of any better way to parse xml? i know that php has some xml functions, .. but it isn't that clear what they do.
sde is offline   Reply With Quote