Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2008
    Posts
    30
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Exclamation How to retrieve/get a part of string? HELP!

    Hello
    So i need... from this..

    http://www.youtube.com/watch?v=6xdp6OM02w4&feature=related

    to get this..

    6xdp6OM02w4

    How can i do this?
    Last edited by QueenZ; 08-30-2009 at 06:07 PM.

  • #2
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    http://www.php.net/parse_url
    http://www.php.net/parse_str
    PHP Code:
    $url 'http://www.youtube.com/watch?v=6xdp6OM02w4&feature=related';

    $query parse_url$urlPHP_URL_QUERY );

    parse_str$query$query );

    echo 
    $query['v']; // 6xdp6OM02w4 

  • Users who have thanked kbluhm for this post:

    QueenZ (08-30-2009)

  • #3
    New Coder
    Join Date
    Jun 2008
    Posts
    30
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Thank you kbluhm! That works great!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •