How to get id from this?

Started on the old forum in January 2011 · view the original in the archive · old links redirect here

11 replies · 585 views · started 15 years ago · 1 min read

4 participants
Jgutz Developer · 119 posts #1

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 🙂

frostymarvelous Senior · 266 posts #5

Ereg is deprecated. Change to preg.

Perfection comes at a cost

I accept liberty!

razzbee Developer · 130 posts #11

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

Jgutz Developer · 119 posts #12

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 😀

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close