3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $domainName = '...cloud.daanscho.one....'; // Strip periods, apply punycode encoding, and convert to lowercase $domainName = strtolower( trim($domainName, '.') ); var_dump($domainName); $domainName = '...cloud.daanscho.one....'; // Strip periods, apply punycode encoding, and convert to lowercase $domainName = strtolower( preg_replace('/^[.]*(?U)(.*)[.]*$/u', '\\1', $domainName) ); var_dump($domainName);
based on 0ZtD1
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
string(18) "cloud.daanscho.one" string(18) "cloud.daanscho.one"