PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm a noob with regexp, so maybe you guys can can figure this one out. I've got a string that's got a URL in it. The URL always starts with a forward slash (/) and ends with the the text "searchradius=5" (minus the quotes, of course). I want to pull the url out and store it as $URL. Here's what I tried.
if that's not what you're looking for, give an example input and output.
Thanks, Dusty. That gets rid of the error and after rereading some regexp info, I understand what's going on. However, this doesn't return anything to the array $URL. Maybe my expression is wrong. Here's an example of the URL I'm trying to capture.
<?
$movie = "this is a test to see if /showtimes/movie_detail.asp?searchmovie=36611&searchdate=9/11/2002&searchzip=35957&searchradius=5 shows up";
preg_match("/\/.*searchradius=5/i",$movie,$url);
echo $urlї0];
?>
would print: /showtimes/movie_detail.asp?searchmovie=36611&searchdate=9/11/2002&searchzip=35957&searchradius=5
Yeah, I figured out what I was doing wrong trying to display the URL. Sorry... I've only been coding PHP about a week now. : ) On a similar note, now that I've stored the URLs in an array, I want remove them from the $movie array. Here's what I'm trying: