alexville Posted February 10, 2008 Share Posted February 10, 2008 Hey, Say I have this in a variable : http://ca.youtube.com/watch?v=uSH5GOevgOk&feature=dir and I want to get rid of the ending &feature=dir and get an output of this in a variable: http://ca.youtube.com/watch?v=uSH5GOevgOk How could I do this? Quote Link to comment Share on other sites More sharing options...
paul2463 Posted February 10, 2008 Share Posted February 10, 2008 <?php $string = "http://ca.youtube.com/watch?v=uSH5GOevgOk&feature=dir"; $start = explode("&",$string); //splits the string into an array on the & sign echo $start[0];//echoes out all before the first mention of an & ?> Quote Link to comment Share on other sites More sharing options...
alexville Posted February 10, 2008 Author Share Posted February 10, 2008 thanks! it worked perfectly! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.