<?php
$txt='"<optgroup label=" Gare du Nord - Gare de l\'Est - 10e"></optgroup><option data-max-adults="3" value="TIMHOTELGEst" selected>━ Timhotel Paris Gare de l\'Est / 3*"';
$re1='.*?'; # Non-greedy match on filler
if ($c=preg_match_all ("/".$re1."/is", $txt, $matches))
{
$word1=$matches[1][0];
print "($word1) \n";
}
$regs = explode(">━ ", $opt);
// preg_match('`<option value="(.+?)" selected>`', $opt, $regs);
var_dump($regs);
Warning: Undefined array key 1 in /in/DXhOG on line 9
Warning: Trying to access array offset on null in /in/DXhOG on line 9
()
Warning: Undefined variable $opt in /in/DXhOG on line 13
Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /in/DXhOG on line 13
array(1) {
[0]=>
string(0) ""
}
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Warning: Undefined array key 1 in /in/DXhOG on line 9
Warning: Trying to access array offset on value of type null in /in/DXhOG on line 9
()
Warning: Undefined variable $opt in /in/DXhOG on line 13
Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in /in/DXhOG on line 13
array(1) {
[0]=>
string(0) ""
}
Output for 8.0.0 - 8.0.30
Warning: Undefined array key 1 in /in/DXhOG on line 9
Warning: Trying to access array offset on value of type null in /in/DXhOG on line 9
()
Warning: Undefined variable $opt in /in/DXhOG on line 13
array(1) {
[0]=>
string(0) ""
}
Output for 7.4.0 - 7.4.33
Notice: Undefined offset: 1 in /in/DXhOG on line 9
Notice: Trying to access array offset on value of type null in /in/DXhOG on line 9
()
Notice: Undefined variable: opt in /in/DXhOG on line 13
array(1) {
[0]=>
string(0) ""
}