Hi, I am trying to split a string of text and break it in to two lines if it is longer than the space I have.
Here is the code I have;
[code=php]
$text = (substr(stripslashes($spot[‘description’]),0, 22). “<br />”.substr(stripslashes($spot[‘description’]),23, 40));
if(substr(stripslashes($spot[‘description’])) > 40){ $text = $text .”…”; }
But am getting this error
[code]Warning: Wrong parameter count for substr() in /home/httpd/vhosts/ziplinestaging.com/httpdocs/spokesmaniframe/iframe.php on line 110
Yet it matched the examples on PHP.net
[url]http://us.php.net/substr
[code=php]<?php
$rest = substr(“abcdef”, 0, -1); // returns “abcde”
$rest = substr(“abcdef”, 2, -1); // returns “cde”
$rest = substr(“abcdef”, 4, -4); // returns “”
$rest = substr(“abcdef”, -3, -1); // returns “de”
?>