0

I need some help with my PHP, I'm generating to make the xml output.

In the xml output, 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= tag to make it like this:

<programme channel='101 ABC FAMILY' start='20140504113000' stop='20140504131000'>

On mine the output show like this:

<programme channel="101 ABC FAMILY" start="20140504113000" stop="20140504131000">

You will see like this:

http://oi57.tinypic.com/2058hs3.jpg

When I open the source code, I can see that I have got the single quotes.

<programme channel='101 ABC FAMILY' start='2014-05-04' stop='2014-05-05'></programme>

The problem may 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 the xml?

2
Contributors
1
Reply
14
Views
3 Years
Discussion Span
Last Post by pritaeas
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.