I am trying to wrap a long text into 140 characters. This doesn't mean i don't need the text after 140 characters. I just need the text to be in chunks of 140 characters each. I first tried chunk_split but that was not up my expectations. Then i tried wordwrap() and that works. But my question though is i figured out how to add a custom "..." at the end of every wrapped string of 137 characters that counts up to 140 chars with "...". But how can i add custom suffix to every wrapped string? like "this is a string (1)", "this is a second string (2)" and so on instead of "..."? Basically i want numbers 1, 2, 3 etc. at the end of every wrapped string instead of the current "..." (dots). Here's my code:
<html>
<form name="longstring" action="longstring.php" method="POST">
<textarea rows="5" cols="100" name="typehere"></textarea>
<input type="submit" value ="submit">
</from>
<br/>
<?php
$longstring = $_POST["typehere"];
echo wordwrap($longstring,137,"...<br>") ;
?>
</html>