3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'export NTPSERVER_1 NTPSERVER_2 NTPSERVER_3 PSLOGHOST LOGHOST RSSHHOST RHPORT NTPSERVER_1=8.8.8.8 NTPSERVER_2= NTPSERVER_3= LOGHOST="8.8.8.8" PSLOGHOST="" RSSHHOST="8.8.8.8" RHPORT=88888'; Preg_match_all("/(\w+)\=(.*)/", $str, $matches); Foreach($matches[1] as $key => $val){ $res[$val] = str_replace('"','',$matches[2][$key]); } Var_dump($res);

preferences:
178.09 ms | 406 KiB | 5 Q