I am trying to pull the get it now button from daily steals homepage but it doesn't seem to work. [WORKS]Pulling the title works fine like this: preg_match_all("'<h2>(.+?)<\/h2>'",$content,$matches); foreach($matches[0] as $match){ $stealtitle[] = $match; } $todaysstealtitle = $stealtitle[0]; Code (markup): [NOT WORKING]Pulling the form finds nothing like this: preg_match_all("'<form class=\"submit\" id=\"getitform\"(.+?)<\/form>'",$content,$matches); foreach($matches[0] as $match){ $stealgetit[] = $match; } $gettodayssteal = $stealgetit[0]; Code (markup): Any advice would be greatly appreciated as its frustrating me (probably a comma or something out of place lol) Thank you in advance
I assume its because its multiline I would do it like this // remove line feeds $content = str_replace("\n",'',$content); preg_match_all('|<form class="submit" id="getitform"(.+?)<\/form>|',$content,$matches); foreach($matches[0] as $match){ $stealgetit[] = $match; } $gettodayssteal = $stealgetit[0]; PHP: good luck
I love you, thank you it worked perfectly (tried to give you +rep but apparently I did in a previous post and it wants me to spread the love somewhere else first)