Jump to content

[SOLVED] Function to cut strings??


JJohnsenDK

Recommended Posts

Hey

 

I want to cut down a string like this:

 

<?php
$text = "Hey you, you funny dude";
$text2 = strlen($text);

if($text2 > 15){
echo "Hey you, yo....";	
}
?>

 

what function can i use to cut in the string like in the example: If $text2 varible is over 15 show the first 15 letters and after that put in four ....

 

hope someone can help :)

Link to comment
https://forums.phpfreaks.com/topic/39020-solved-function-to-cut-strings/
Share on other sites

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.