The Blog of Gordon Milcham

Printing first characters of a text

This prints first 200 characters of a given text. 

$content = $this->artist->name;
$pos = strpos($content, ' ', 200);
echo substr($content,0,$pos ); 


Subscribe to get the latest posts sent to your email.




Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.