Hi. I have the following line;
<option value="Aberdeenshire">Aberdeenshire</option>
I have over 200 of these held in an array, and am using a 'foreach' to grab the stuff inside the <option>*</option> tag. I currently have;
$line = preg_replace("/<option value=\"(.+?)\">/","",$line);
$line = preg_replace("/<\/option>/","",$line);
However, this is not working for me. It simply returns things like;
UL
Anyone got any ideas where I'm going wrong? In Perl it would be easy;
$var =~ m/<option value=\"(.+?)\">(.+?)</option>/ and $val = $2;
I'm quite new to PHP....so any help would be much appreciated
Cheers
Andy
<option value="Aberdeenshire">Aberdeenshire</option>
I have over 200 of these held in an array, and am using a 'foreach' to grab the stuff inside the <option>*</option> tag. I currently have;
$line = preg_replace("/<option value=\"(.+?)\">/","",$line);
$line = preg_replace("/<\/option>/","",$line);
However, this is not working for me. It simply returns things like;
UL
Anyone got any ideas where I'm going wrong? In Perl it would be easy;
$var =~ m/<option value=\"(.+?)\">(.+?)</option>/ and $val = $2;
I'm quite new to PHP....so any help would be much appreciated

Cheers
Andy