Too Big World

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 ); 

Discover more from Too Big World

Subscribe to get the latest posts sent to your email.

Categories:

Tags:


Leave a Reply

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