Vote count:
0
Im creating a audio library and i have a upload function. The upload function should read the ID3 tags to store it in the database. Since the sounds will be arabic tracks, the ID3 tags is in arabic and the function i have right now reads the tags but don't read the arabic tags, it returns "?????" i all arabic words/names. How can i encode it? What is the solution?
class CMP3File {
var $title;var $artist;var $album;var $year;var $comment;var $genre;
function getid3 ($file) {
if (file_exists($file)) {
$id_start=filesize($file)-128;
$fp=fopen($file,"r");
fseek($fp,$id_start);
$tag=fread($fp,3);
if ($tag == "TAG") {
$this->title=fread($fp,30);
$this->artist=fread($fp,30);
$this->album=fread($fp,30);
$this->year=fread($fp,4);
$this->comment=fread($fp,30);
$this->genre=fread($fp,1);
fclose($fp);
return true;
} else {
fclose($fp);
return false;
}
} else {
return false;
}
}
}
asked 1 min ago
Aucun commentaire:
Enregistrer un commentaire