Jump to content

[SOLVED] substr take out word isntead of character...


jesushax

Recommended Posts

maybe something like...

 

$titleLength=strlen($title);
if ($titleLength > 40) {
substr($title,0,40); // Or do whatever you want to the string if it is longer

// Maybe even something like this to replace a word if it is longer...
$search = array("'");
$replace = array("");
$fields = str_replace($search,$replace,$fields);
}

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.