I need some help with my PHP, I'm generating to make the xml output.
On the xml tree, I can see that I'm using double quotes but i want to use the single quotes.
I want to add the single quotes in the
<programme
channel='MY CHANNEL NAME'
start='20140504113000'
stop='20140504131000'>
On the xml tree, it will show like this:
<programme
channel="MY CHANNEL NAME"
start="20140504113000"
stop="20140504131000">
You will see like this:
When I open the source code, I can see that I have got the single quotes.
<programme
channel='MY CHANNEL NAME'
start='2014-05-04'
stop='2014-05-05'>
</programme>
Not sure if the problem is lie in this line:
$xml .= "<programme channel='$my_id $channel' start='$stoptime' stop='$starttime'>";
Here is the code:
<?php
header("Content-Type: text/xml");
$my_id = '101';
$channel = 'ABC FAMILY';
$starttime = '2014-05-04';
$stoptime = '2014-05-05';
$xml .= "
<programme channel='" . $my_id. " " . $channel . "' start='" .
$starttime . "' stop='" . $stoptime . "'>";
//$xml .= "<programme channel='".$channel."' start='".$starttime."'>";
//$xml .= "<programme channel='$my_id $channel' start='$starttime'
stop='$stoptime'>";
$xml .= '</programme>';
echo $xml;
$handle = fopen("myChannel.xml", "w");
fwrite ($handle, $xml);
?>
How I can see the single quotes in the xml tree when I'm generating to make the xml?