Jump to content


Photo

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


  • Please log in to reply
4 replies to this topic

#1 DaveLinger

DaveLinger
  • Members
  • PipPipPip
  • Advanced Member
  • 268 posts
  • LocationWV, USA

Posted 14 September 2006 - 01:56 AM

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.co...omglol/page.php

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

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

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

Thanks!
http://www.DaveLinger.com
dave at linger dot com

#2 Zane

Zane
  • Administrators
  • Advanced Member
  • 4,134 posts

Posted 14 September 2006 - 06:05 AM

Question 1
yes, use dirname($path);

Question 2
yes, id3_get_tag($filename);

btn_donate_SM.gif Want to thank me? Contribute to my PayPal piggy-bank
 

172938.png

#3 gerkintrigg

gerkintrigg
  • Members
  • PipPipPip
  • Magician
  • 828 posts
  • LocationBristol, UK
  • Age:37

Posted 14 September 2006 - 06:24 AM

and MP3 tags?
Neil Trigger - http://www.ghostlypublishing.co.uk - Ghostly Publishing - Children's Fantasy Books

#4 Zane

Zane
  • Administrators
  • Advanced Member
  • 4,134 posts

Posted 14 September 2006 - 06:45 AM

yeah...just give it the correct filename/path

and it'll work

btn_donate_SM.gif Want to thank me? Contribute to my PayPal piggy-bank
 

172938.png

#5 DaveLinger

DaveLinger
  • Members
  • PipPipPip
  • Advanced Member
  • 268 posts
  • LocationWV, USA

Posted 14 September 2006 - 07:26 PM

Question 1
yes, use dirname($path);

Question 2
yes, id3_get_tag($filename);


so... if I put...

<?php
dirname($path);
echo $path;
?>

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:
<?php
$page=$_SERVER['PHP_SELF'];
$dir=dirname($page);
echo "$page is in $dir";
?>

http://www.DaveLinger.com
dave at linger dot com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users