Jump to content

Archived

This topic is now archived and is closed to further replies.

DaveLinger

2 unrelated php questions... folder names and id3 tags

Recommended Posts

2 unrelated questions here...

how can I set a variable to contain the folder in which the current php file is being read from? for instance...

http://www.google.com/test/omglol/page.php

how could I get a variable to contain "omglol"?

--------------------

Also, can php read mp3 ID3 tags? If so, how?

Thanks!

Share this post


Link to post
Share on other sites
[quote author=zanus link=topic=107972.msg433951#msg433951 date=1158213935]
Question 1
yes, use dirname($path);

Question 2
yes, id3_get_tag($filename);
[/quote]

so... if I put...

[code]
<?php
dirname($path);
echo $path;
?>[/code]

that should echo the folder of the file I'm reading?

also, can you explain id3_get_tag($filename); some more? There are many ID3 tags, which does that function retrieve? I'd want to seperate artist, title, album, etc.

edit: I see that the id3 thing sets the id3 parts as an array, so I got that, and I just got the directory code working using this code:
[code]
<?php
$page=$_SERVER['PHP_SELF'];
$dir=dirname($page);
echo "$page is in $dir";
?>[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.