I have this: if (empty($comment['username'])) { $comment['username'] = 'Unknown'; } $comments .= $tpl->pull_template ('comment'); PHP: Basically, I want it so if the username = admin, replace admin with <u>admin</u>, can anyone help?
preg_replace("/".$comment['username']."/si", "<u>".$comment['username']."</u>", $pagadata); dunno what pagedata is, but that gives you the idea
In the code you posted I think you may be missing some information that could aid us in helping you.. but from the sound of it why not just make a simple if statement? if (empty($comment['username'])) { if ($comment['username'] = "admin") { $comment['username'] = "<em>admin</em>"; } else { $comment['username'] = 'Unknown'; } } $comments .= $tpl->pull_template ('comment'); PHP: Unless you want it for any user who is a admin and not just the username "admin".
That's why I asked for if help, I suck at PHP. I done that and got an unexpected $end on line something so added another } but that didn't show the comments.