A bad way to write XML files in php :)

$myFile = “testFile.xml”;
$video_path = $values[“video_path”];
$photo_path = $values[“photo_path”];
$url = $values[“url”];
$fh = fopen($myFile, ‘w’);
$stringData = ‘<?xml version=”1.0″ encoding=”UTF-8″?>
<playitem caption=”300″ path=”uploads/’.$video_path.'” image=”” options=”” clickurl=”” clicktarget=”_blank” endurl=”” styleoftarget=”browser” endtarget=””>
<advertitem position=”00:00:00:000″ duration=”00:00:10:000″ videotype=”image” filepath=”uploads/’.$photo_path.'” clickurl=”‘.$url.'” clicktarget=”_blank” fadein=”0″ fadeout=”1″ options=””/>
fwrite($fh, $stringData);


Note: Better get a good solution.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close