Go Back   CodingForums.com > :: Client side development > XML

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-05-2012, 02:10 PM   PM User | #1
ronuk99
New Coder

 
Join Date: Jun 2012
Posts: 19
Thanks: 5
Thanked 0 Times in 0 Posts
ronuk99 is an unknown quantity at this point
Exclamation php to xml

Hi hope some one can help me out with this. Basically i need to transfer data from a php array to xml. The code in php works out the time of day and weekly program schedule . example at www.vikingradio.net can some one show me how i transfer this info to xml . Much appreciated with any help

ron



note hope i got this code right this time to display correctly on forum


Code:
<?php
	include("data.php");

echo "<div class='Shows'>";
echo "<div class='day'>" . date("l",strtotime($showday)) . " " . date("G:i:s",$UKTime) . "</div>";
for ($i=$Si;$i<$Ei;$i++) {
	$tShow = (object) $thisShows[$i];
	echo "<div class='Sitem'>\n";
	
	echo "<div class='indicator'>" . ($i==$showK?"ON AIR NOW:":"&nbsp;") . "</div>";echo '<img src="'.$playing.'">';
	echo "<div class='showtime'>" . str_pad($tShow->start,2,"0",STR_PAD_LEFT) . ".00-" . str_pad($tShow->end,2,"0",STR_PAD_LEFT) . ".00</div>";
	echo "<div class='descr'>" . $tShow->descr;
		if ($tShow->descr_long) echo "<div class='descr_long'>" . $tShow->descr_long . "</div>";
	echo "</div>";
	echo "<div class='sep'></div>";
	echo "</div>\n";
}
	echo "<p class='pclear'></p>\n";
echo "</div>";

?>

Last edited by Alex Vincent; 10-05-2012 at 05:39 PM.. Reason: adding closing code tag
ronuk99 is offline   Reply With Quote
Old 10-05-2012, 02:12 PM   PM User | #2
ronuk99
New Coder

 
Join Date: Jun 2012
Posts: 19
Thanks: 5
Thanked 0 Times in 0 Posts
ronuk99 is an unknown quantity at this point
sorry admin cannot get inline for code. please explain how ron
ronuk99 is offline   Reply With Quote
Old 10-05-2012, 05:40 PM   PM User | #3
Alex Vincent
Moderator


 
Join Date: May 2002
Location: Hayward, CA
Posts: 1,427
Thanks: 1
Thanked 19 Times in 17 Posts
Alex Vincent is on a distinguished road
I'm not sure I understand the question - but since you have PHP, you can write XML all day long if you want from that PHP script. You just need to come up with the right XML language, even if it means you invent that language.

About the only thing you'd need to add to your script (besides the XML language) is the following line:

Code:
header("Content-type: application/xml");
__________________
"The first step to confirming there is a bug in someone else's work is confirming there are no bugs in your own."
June 30, 2001
author, Verbosio prototype XML Editor
author, JavaScript Developer's Dictionary
https://alexvincent.us/blog
Alex Vincent is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:07 AM.


Advertisement
Log in to turn off these ads.