3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $acceptLanguagesHeader = "da, en-gb;q=0.8, en;q=0.7"; $languageParts = explode(';', $acceptLanguagesHeader); var_dump($languageParts); $languagesString = reset($languageParts); var_dump(explode(',', $languagesString));
based on 8rGrt
Output for 4.3.0 - 7.2.0
array(3) { [0]=> string(9) "da, en-gb" [1]=> string(9) "q=0.8, en" [2]=> string(5) "q=0.7" } array(2) { [0]=> string(2) "da" [1]=> string(6) " en-gb" }