- var_dump: documentation ( source)
- strpos: documentation ( source)
- preg_match: documentation ( source)
<?php
var_dump(
strpos('.example.com.hacked', '.example.com'),
preg_match('/\.example.com$/', 'www.example.com'),
preg_match('/\.example.com$/', 'www.example.com.hacked'),
);