- preg_match: documentation ( source)
- htmlentities: documentation ( source)
<?php
function formatLink($post) {
if(preg_match('/^\>\>[0-9]{+}$/', $post))
{
return "<font color=\"red\">".htmlentities($post)."</font>";
}
else
{
return "<font color=\"#b7b7b7\">".htmlentities($post)."</font>";
}
}
echo formatLink(">>86721678");