How to get id from this?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to get id from this?

    Im not good in php so please someone teach me how to get id from this code
    PHP 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
    » PornZeriEs.com - | New! Hottest Porn Movies

    #2
    $link = I.Y.A.Z - Love.mp3 - 4shared.com - online file sharing and storage - download
    use this
    Code:
    $link=ereg_replace("(http:\/\/www\.4shared\.com\/audio\/)(.+)\/(.+)$",\\2,$link);
    echo $link;
    
    or use this
    
    $link=explode("/",$link);
    
    $link=$link[4];

    Comment


      #3
      I will try that,. Thanks a lot
      » PornZeriEs.com - | New! Hottest Porn Movies

      Comment


        #4
        It works! Thanks hitted
        » PornZeriEs.com - | New! Hottest Porn Movies

        Comment


          #5
          Ereg is deprecated. Change to preg.
          Perfection comes at a cost



          I accept liberty!

          Comment


            #6
            well ,ereg is for native php coding whiles the preg is borrowed from perl (pcre).no difference but a slight change in rule.

            Comment


              #7
              Originally posted by razzbee View Post
              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

              Comment


                #8
                @gumslone and frosty,thanx for the info....nice

                Comment


                  #9
                  You're welcome. PHP: ereg - Manual
                  Perfection comes at a cost



                  I accept liberty!

                  Comment


                    #10
                    tnx also @gumslone & @frosty 4 the info..by the way I used the explode code
                    » PornZeriEs.com - | New! Hottest Porn Movies

                    Comment


                      #11
                      u can still use the first function do it this way...
                      Code:
                      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

                      Comment


                        #12
                        Originally posted by razzbee View Post
                        u can still use the first function do it this way...
                        Code:
                        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 :D
                        » PornZeriEs.com - | New! Hottest Porn Movies

                        Comment

                        Working...
                        X