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, strpos($_SERVER["HTTP_USER_AGENT"], "on") - strpos($_SERVER["HTTP_USER_AGENT"], "v")-7); $Client["Device"] = substr($_SERVER["HTTP_USER_AGENT"], strpos($_SERVER["HTTP_USER_AGENT"], "on") + 3); $Client["Version"] = substr($_SERVER["HTTP_USER_AGENT"], strpos($_SERVER["HTTP_USER_AGENT"], "v") + 1, 6); print_r($Client);
based on n7lNU
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [Client] => TeachMe-App [OS] => Android 4.4.2 [Device] => generic [Version] => 000003 )