3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $_SERVER["HTTP_USER_AGENT"] = "TeachMe-App v000003 Android 4.4.2 on generic"; $Client = array(); $Client["Client"] = substr($_SERVER["HTTP_USER_AGENT"], 0, strpos($_SERVER["HTTP_USER_AGENT"], "v")-1) or die(); $Client["OS"] = substr($_SERVER["HTTP_USER_AGENT"], strpos($_SERVER["HTTP_USER_AGENT"], "v")+7, strlen($_SERVER["HTTP_USER_AGENT"]) - (strlen($_SERVER["HTTP_USER_AGENT"]) - strpos($_SERVER["HTTP_USER_AGENT"], "on"))-1); $Client["Device"] = substr($_SERVER["HTTP_USER_AGENT"], strpos($_SERVER["HTTP_USER_AGENT"], "on") + 3); print_r($Client);
based on g98Un
Output for 4.3.0 - 7.1.0
Array ( [Client] => TeachMe-App [OS] => Android 4.4.2 on generic [Device] => generic )