Why script doesn't work?

Locked
kenshi245
User
Posts: 2
Joined: Wed Nov 20, 2013 1:31 pm
Are you a spambot?: no

Why script doesn't work?

Post by kenshi245 » Wed Nov 20, 2013 1:39 pm

I have code, but it prints nothing(( what's problem??

Code: Select all

<?php
require_once('getid3.php');

$getID3 = new getID3;

$filename = "testsound.mp3";
$ThisFileInfo = $getID3->analyze($filename);

getid3_lib::CopyTagsToComments($ThisFileInfo);

echo $ThisFileInfo['comments_html']['artist'][0];
echo $ThisFileInfo['tags']['id3v2']['title'][0];
echo $ThisFileInfo['audio']['bitrate'];  
echo $ThisFileInfo['playtime_string'];  
but if i paste this:

Code: Select all

foreach($ThisFileInfo as $a) 
echo $a."<br />";
it prints this:

Code: Select all

1.9.7-20130705
13170688
testsound.mp3
C:/home/192.168.79.128/www
C:/home/192.168.79.128/www/testsound.mp3
UTF-8
Array

James Heinrich
getID3() v1 developer
Posts: 1471
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: Why script doesn't work?

Post by James Heinrich » Wed Nov 20, 2013 1:44 pm

Try looking at the whole returned array:

Code: Select all

echo '<pre>'.print_r($ThisFileInfo, true).'</pre>';
And/or look specifically at the 'error' and 'warning' keys that may be returned if there's a problem.

Also, if you're looking to see where information is returned, what information is in a file, or why something's not working as expected, open /demo/demo.browse.php in your browser and open testsound.mp3 from there and you'll see all the info you want. You can then modify your code accordingly.

kenshi245
User
Posts: 2
Joined: Wed Nov 20, 2013 1:31 pm
Are you a spambot?: no

Re: Why script doesn't work?

Post by kenshi245 » Wed Nov 20, 2013 2:27 pm

Thx, i've got it!

Locked