Code Comments
Programming Forum and web based access to our favorite programming groups.Hi,
I parsed an XML file and pushed the results into an array. My question is, w
hen I assign this array, $result, to Smarty, how do I reference it ?
I have something like:
{section name=feed loop=$news}
<tr>
<td>
{$news[feed].COPYRIGHT}
</td>
</tr>
{/section}
How do I reference, say, the LINK under ITEMS ? Please advise.
If I do a var_dump on $result, it looks like this:
array(10) {
["TITLE"]=>
string(39) "BBC News | News Front Page | UK Edition"
["LINK"]=>
string(47) "http://news.bbc.co.uk/go/rss/-/1/hi/default.stm"
["DESCRIPTION"]=>
string(33) "Updated every minute of every day"
["LANGUAGE"]=>
string(5) "en-gb"
["LASTBUILDDATE"]=>
string(27) "Wed, 27 Apr 05 23:59:27 GMT"
["COPYRIGHT"]=>
string(92) "Copyright: (C) British Broadcasting Corporation, http://news.bbc.co.uk
/1/hi/help/3281849.stm"
["DOCS"]=>
string(33) "http://www.bbc.co.uk/syndication/"
["TTL"]=>
string(2) "15"
["IMAGE"]=>
array(3) {
["TITLE"]=>
string(8) "BBC News"
["URL"]=>
string(56) "http://news.bbc.co.uk/nol/shared/img/bbc_news_120x60.gif"
["LINK"]=>
string(21) "http://news.bbc.co.uk"
}
["ITEMS"]=>
array(5) {
[0]=>
array(5) {
["TITLE"]=>
string(31) "Early Iraq legal opinion leaked"
["DESCRIPTION"]=>
string(115) "The attorney general doubted the Iraq war would be legal withou
t a new resolution from the UN, leaked advice shows."
["LINK"]=>
string(79) "http://news.bbc.co.uk/go/rss/-/1/hi/uk_politics/vote_2005/frontp
age/4491105.stm"
["GUID"]=>
string(70) "http://news.bbc.co.uk/1/hi/uk_politics/vote_2005/frontpage/44911
05.stm"
["PUBDATE"]=>
string(27) "Wed, 27 Apr 05 22:32:09 GMT"
}
[1]=>
array(5) {
["TITLE"]=>
string(32) "Man arrested over Abigail attack"
["DESCRIPTION"]=>
string(96) "A 25-year-old man has been arrested by detectives hunting the ma
n who stabbed Abigail Witchalls."
["LINK"]=>
string(73) "http://news.bbc.co.uk/go/rss/-/1/hi/england/southern_counties/44
92119.stm"
["GUID"]=>
string(64) "http://news.bbc.co.uk/1/hi/england/southern_counties/4492119.stm
"
["PUBDATE"]=>
string(27) "Wed, 27 Apr 05 23:53:19 GMT"
}
[2]=>
array(5) {
["TITLE"]=>
string(32) "Jackson's ex-wife in witness box"
["DESCRIPTION"]=>
string(122) "Prosecutors in Michael Jackson's child abuse trial begin questi
oning the star's ex-wife and mother of two of his children."
["LINK"]=>
string(67) "http://news.bbc.co.uk/go/rss/-/1/hi/entertainment/music/4490259.
stm"
["GUID"]=>
string(58) "http://news.bbc.co.uk/1/hi/entertainment/music/4490259.stm"
["PUBDATE"]=>
string(27) "Wed, 27 Apr 05 21:58:53 GMT"
}
[3]=>
array(5) {
["TITLE"]=>
string(33) "US terror charge Briton convicted"
["DESCRIPTION"]=>
string(112) "A British man is found guilty of attempting to support terroris
m after trying to sell a missile to an FBI agent."
["LINK"]=>
string(50) "http://news.bbc.co.uk/go/rss/-/1/hi/uk/4491181.stm"
["GUID"]=>
string(41) "http://news.bbc.co.uk/1/hi/uk/4491181.stm"
["PUBDATE"]=>
string(27) "Wed, 27 Apr 05 20:07:48 GMT"
}
[4]=>
array(5) {
["TITLE"]=>
string(28) "Airbus A380 completes flight"
["DESCRIPTION"]=>
string(103) "The world's largest passenger plane, the Airbus A380, lands saf
ely, having completed its maiden flight."
["LINK"]=>
string(56) "http://news.bbc.co.uk/go/rss/-/1/hi/business/4488361.stm"
["GUID"]=>
string(47) "http://news.bbc.co.uk/1/hi/business/4488361.stm"
["PUBDATE"]=>
string(27) "Wed, 27 Apr 05 17:32:10 GMT"
}
}
}
--
Roger
---------------------------------------------------
Sign Up for free Email at http://ureg.home.net.my/
---------------------------------------------------
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.