|
|
|
|
![]() ![]() |
| lixas |
Jan 11 2005, 08:54 AM
Post
#1
|
|
Guests |
How to write to file such symbols like --> " <-- or --> / <-- and --> < <-- and --> > <--- ?????
|
|
|
|
| lixas |
Jan 11 2005, 08:59 AM
Post
#2
|
|
Guests |
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 |
|
|
|
| lixas |
Jan 11 2005, 09:02 AM
Post
#3
|
|
Guests |
<?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 finished can anyone tell me how to do the xml file, with structure who i wroted in post before ? |
|
|
|
| God |
Jan 11 2005, 06:18 PM
Post
#4
|
|
Guests |
No idea about the XML, but you can write the " and symbols in php using
CODE " and escape sequences. The /, <, and > symbols don't require escape sequesnces, meanign you can just put the symbols in.
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 30th August 2008 - 02:11 AM |