$pat_a = array (
'/.+(\\&'.$var.')=(.*)\\&/AU', /* in the middle */
'/.+\\?('.$var.')=(.*\\&).+/AU', /* at front, more follow */
'/.+(\\?'.$var.')=(.*)$/AU', /* at front and only var */
'/.+(\\&'.$var.')=(.*)$/AU' /* at the end */
);
$pat_a = array (
'/.+(\\&'.$var.')=(.*)\\&/AU', /* in the middle */
'/.+\\?('.$var.')=(.*\\&).+/AU', /* at front, more follow */
'/.+(\\?'.$var.')=(.*)$/AU', /* at front and only var */
'/.+(\\&'.$var.')=(.*)$/AU' /* at the end */
);