DaveLinger Posted September 14, 2006 Share Posted September 14, 2006 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.phphow could I get a variable to contain "omglol"?--------------------Also, can php read mp3 ID3 tags? If so, how?Thanks! Link to comment https://forums.phpfreaks.com/topic/20681-2-unrelated-php-questions-folder-names-and-id3-tags/ Share on other sites More sharing options...
Zane Posted September 14, 2006 Share Posted September 14, 2006 Question 1yes, use dirname($path);Question 2yes, id3_get_tag($filename); Link to comment https://forums.phpfreaks.com/topic/20681-2-unrelated-php-questions-folder-names-and-id3-tags/#findComment-91524 Share on other sites More sharing options...
gerkintrigg Posted September 14, 2006 Share Posted September 14, 2006 and MP3 tags? Link to comment https://forums.phpfreaks.com/topic/20681-2-unrelated-php-questions-folder-names-and-id3-tags/#findComment-91537 Share on other sites More sharing options...
Zane Posted September 14, 2006 Share Posted September 14, 2006 yeah...just give it the correct filename/pathand it'll work Link to comment https://forums.phpfreaks.com/topic/20681-2-unrelated-php-questions-folder-names-and-id3-tags/#findComment-91558 Share on other sites More sharing options...
DaveLinger Posted September 14, 2006 Author Share Posted September 14, 2006 [quote author=zanus link=topic=107972.msg433951#msg433951 date=1158213935]Question 1yes, use dirname($path);Question 2yes, id3_get_tag($filename);[/quote]so... if I put...[code]<?phpdirname($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] Link to comment https://forums.phpfreaks.com/topic/20681-2-unrelated-php-questions-folder-names-and-id3-tags/#findComment-91920 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.