I need a little help with my regular expression.
Here is what I've got:
function formatLink($post) {
if(preg_match('/^\>\>[0-9]{+}$/', $post)) {
return "<font color=\"red\">".$post."</font>";
} else {
return "<font color=\"#b7b7b7\">".$post."</font>";
}
}
echo formatLink(">>86721678");
And honestly I don't know what doesn't it work. It should work for any string like this:
>>1
>>87759
Very similar to imageboard-like post ref.