views:

25

answers:

1

I want to take a value ex: <input type="hidden" name="quicksearch" value="**1**" /> from a third party website.

then place that value on my website ex: <input type="hidden" name="quicksearch" value="**REPLACE WITH 1**" />

+1  A: 
$html = file_get_contents('http://www.somepage.youwant/to.get');
$newHtml = preg_replace('!<input type="hidden" name="quicksearch" value="\*\*([0-9]+)\*\*" />!', '<input type="hidden" name="quicksearch" value="**REPLACE WITH \1**" />', $html);

file_get_contents

preg_replace

Back references

webbiedave