This php code displays a name from the database but sometimes the names are too long. How do i trim the name to only display 20 characters? $itemhtml = str_replace( '{name}', $item->link_name, $itemhtml );
$itemhtml = str_replace( '{name}', $item->link_name, $itemhtml ); // Now we shorten $itemhtml to 20 characters $itemhtml = substr("$itemhtml", 0, 20); PHP: