I have a MySQL database which has some long links in it... it want to display these on my site but if the link is over say 20 characters I want to display [LONG LINK] instead...
How do i find out how long it is??
strlen()
$links = array('www.a.com','www.b.com','www.c.com'); foreach ($links as $link) { if strlen($link >= 20) echo "[LONG LINK]; else echo $link; }