Jump to content

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!
[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]
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.