note 128931 added to function.mb-strimwidth
| From: | jamesgrimshaw2006 at gmail dot com | Date: | Thu, 05 Oct 2023 09:56:01 +0000 |
| Subject: | note 128931 added to function.mb-strimwidth | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220890@lists.php.net to get a copy of this message | ||
mb_strimwidth will only append "trim_marker" if the string is over the width.
*test code*
$HashTags = 'Results';
$socialmediatext = 'abcdefghijklmnopqrstuvwxyz';
for( $i=0; $i<=20; $i++ )
{
$socialmediatext .= '.';
$Twittext = mb_strimwidth($socialmediatext,0,35,$HashTags);
echo "<p>[".strlen($Twittext)."]$Twittext</p>";
}
*output*
[27]abcdefghijklmnopqrstuvwxyz.
[28]abcdefghijklmnopqrstuvwxyz..
[29]abcdefghijklmnopqrstuvwxyz...
[30]abcdefghijklmnopqrstuvwxyz....
[31]abcdefghijklmnopqrstuvwxyz.....
[32]abcdefghijklmnopqrstuvwxyz......
[33]abcdefghijklmnopqrstuvwxyz.......
[34]abcdefghijklmnopqrstuvwxyz........
[35]abcdefghijklmnopqrstuvwxyz.........
[35]abcdefghijklmnopqrstuvwxyz..Results
[35]abcdefghijklmnopqrstuvwxyz..Results
[35]abcdefghijklmnopqrstuvwxyz..Results
[35]abcdefghijklmnopqrstuvwxyz..Results
[35]abcdefghijklmnopqrstuvwxyz..Results
[35]abcdefghijklmnopqrstuvwxyz..Results
[35]abcdefghijklmnopqrstuvwxyz..Results
[35]abcdefghijklmnopqrstuvwxyz..Results
[35]abcdefghijklmnopqrstuvwxyz..Results
[35]abcdefghijklmnopqrstuvwxyz..Results
[35]abcdefghijklmnopqrstuvwxyz..Results
[35]abcdefghijklmnopqrstuvwxyz..Results
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.157.134 (proxied: 88.81.103.107)
----
Manual Page -- https://php.net/manual/en/function.mb-strimwidth.php
Edit -- https://main.php.net/note/edit/128931
Del: integrated -- https://main.php.net/note/delete/128931/integrated
Del: useless -- https://main.php.net/note/delete/128931/useless
Del: bad code -- https://main.php.net/note/delete/128931/bad+code
Del: spam -- https://main.php.net/note/delete/128931/spam
Del: non-english -- https://main.php.net/note/delete/128931/non-english
Del: in docs -- https://main.php.net/note/delete/128931/in+docs
Del: other reasons-- https://main.php.net/note/delete/128931
Reject -- https://main.php.net/note/reject/128931
Search -- https://main.php.net/manage/user-notes.php