Any suggestion how to do the result value option without disabled option with php preg_match_all?
<option value="1" disabled="disabled"> google</option>
<option value="2" selected="selected">- yahoo</option>
<option value="3">- youtube</option>
<option value="4">- facebook</option>
<option value="5" disabled="disabled"> twitter</option>
<option value="6">- tumblr</option>
<option value="7">- bing</option>
how to echo just value without disabled options maybe with preg_match_all?
i have some code but not work,
$string = array(
'/<option value=\"(.*)\" selected=\"selected\">-/sU',
'/<option value=\"(.*)\">-/U',);
$option = curl_exec($ch);
foreach ($string as $key) {
if (preg_match_all($key, $option, $matches)) {
$count = count($matches[1]);
for ($i=0; $i < $count ; $i++) {
echo $matches[1][$i]."
";
}
}else {
echo "match NOT found";
}
}
i want to the result like this,
value = 2,3,4,6,7
thanks for helping,