Hi guys, I’m trying to try trim the characters of array ( ‘title’ ) to 70 characters if they are over 70. Does anyone know how to do this please? The code I’ve got is:
$product_data[‘title’] = $product->getName();
Thankyou anyone!
Hi guys, I’m trying to try trim the characters of array ( ‘title’ ) to 70 characters if they are over 70. Does anyone know how to do this please? The code I’ve got is:
$product_data[‘title’] = $product->getName();
Thankyou anyone!
$product_data[‘title’] = substr($product->getName(), 0 , 70);
Substr is used like this: substr($stringname, start-pos, length)… Hope that helps…