iGuest 3 Report post Posted January 11, 2005 How to write to file such symbols like --> " <-- or --> / <-- and --> < <-- and --> > <--- ????? Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 11, 2005 or it is better way to create xml file with such structure:<?xml version="1.0" encoding="UTF-8"?><player showDisplay="yes" showPlaylist="no"><song path="mp3/Absent_No control.mp3" title= "Absent- No control" /></player>i need that scrit read a directory, remove last for symbols (.mp3) and create a file with such structure. in this file only changing filename and filetitle, who is generated from filename Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 11, 2005 <?php$default_dir = "./ist-04";$fvardas = 'playlist.xml';if(!($dp = opendir($default_dir))) die("Nepavyksta atidaryti katalogo $default_dir.");while($file = readdir($dp) ) $filenames[] = $file;closedir($dp);$handle = fopen($fvardas, 'w+');// Write $somecontent to our opened file. if (file_put_contents($handle, $fvardas) === FALSE) { echo "Cannot write to file ($fvardas)"; exit; }sort($filenames);for($i=0; $i < count($filenames); $i++)if($filenames[$i] != '.' && $filenames[$i] != '..'){$last=substr($filenames[$i], 0, -4);echo $last; ?><br><?;}?>this script is not finishedcan anyone tell me how to do the xml file, with structure who i wroted in post before ? Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 11, 2005 No idea about the XML, but you can write the " and symbols in php using " and escape sequences. The /, <, and > symbols don't require escape sequesnces, meanign you can just put the symbols in. Share this post Link to post Share on other sites