Im not good in php so please someone teach me how to get id from this code
$link = http://www.4shared.com/audio/0Po_BkGJ/IYAZ_-_Love.htm;
Using php? I dont now if thats right, I just want to get the (0Po_BkGJ) Please someone tell me how 🙂
Started on the old forum in January 2011 · view the original in the archive · old links redirect here
Im not good in php so please someone teach me how to get id from this code
$link = http://www.4shared.com/audio/0Po_BkGJ/IYAZ_-_Love.htm;
Using php? I dont now if thats right, I just want to get the (0Po_BkGJ) Please someone tell me how 🙂
$link = I.Y.A.Z - Love.mp3 - 4shared.com - online file sharing and storage - download
use this
$link=ereg_replace("(http:\/\/www\.4shared\.com\/audio\/)(.+)\/(.+)$",\\2,$link);
echo $link;
or use this
$link=explode("/",$link);
$link=$link[4];
Ereg is deprecated. Change to preg.
Perfection comes at a cost
I accept liberty!
well ,ereg is for native php coding whiles the preg is borrowed from perl (pcre).no difference but a slight change in rule.
razzbee wrote: well ,ereg is for native php coding whiles the preg is borrowed from perl (pcre).no difference but a slight change in rule.
PHP: ereg - Manual This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.
Advertise your mobile site for FREE with AdTwirl
You're welcome. PHP: ereg - Manual
Perfection comes at a cost
I accept liberty!
tnx also
GumSlone & @frosty 4 the info..by the way I used the explode code 🙂
u can still use the first function do it this way...
Preg_replace("/^(http:\/\/www\.)?(4 s h a r e d \ . c o m \ / a u d i o \ / ) ( . + ) \ / ( . + ) $/",$3,$link);
Change the $3 to %3 if it fails. Pardon me for mistakes im on mobile
razzbee wrote: u can still use the first function do it this way...
Preg_replace("/^(http:\/\/www\.)?(4 s h a r e d \ . c o m \ / a u d i o \ / ) ( . + ) \ / ( . + ) $/",$3,$link);Change the $3 to %3 if it fails. Pardon me for mistakes im on mobile
Tnx, I'll save it for back up 😀