Results 1 to 2 of 2
-
24th Oct 2011, 05:06 PM #1OPMemberWebsite's:
LinksBox.net TechnologyTwist.comHow to make a text line without wrap ?
Hello
I want to know how to stop warping a long text line in php
Means we set the value of characters after that it would be like ....\
Example
Before -
I love php but I don't know how to use it exactly.
After -
I love php but I don't know .....
please help me.
Thanks,
mannmannNmeet Reviewed by mannNmeet on . How to make a text line without wrap ? Hello I want to know how to stop warping a long text line in php Means we set the value of characters after that it would be like ....\ Example Before - I love php but I don't know how to use it exactly. Rating: 5
-
24th Oct 2011, 05:14 PM #2Respected MemberWebsite's:
DL4Everything.com Soft2050.inThis could be easily achieved with php substr function
Link: http://php.net/manual/en/function.substr.php
Example code to do your task:
PHP Code:<?php
$maxlength = 30;
$actualstring = "I love php but I don't know how to use it exactly.";
$outputstring = (strlen($actualstring) > $maxlength) ? substr($actualstring, 0, $maxlength) . "..." : $actualstring;
echo $outputstring;
?>
The above code will not work if actualstring is small then maxlength! it will only output default data
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Password image wrap around text ??/
By sandip1110 in forum Graphics AreaReplies: 11Last Post: 7th Apr 2012, 06:56 AM -
In line image and text...
By r00ts in forum WordpressReplies: 2Last Post: 24th Mar 2012, 02:24 PM -
[TUT]How to make 3D Text in photoshop CS5
By Rock|the|world in forum Graphics AreaReplies: 5Last Post: 22nd Oct 2011, 08:08 AM -
Make Any Links Clickable in WordPress with One-Line Code
By ThreeNF in forum Webmaster ResourcesReplies: 8Last Post: 13th May 2011, 02:46 PM -
over wrap in codes?
By Arcangel061099 in forum IP.BoardReplies: 7Last Post: 5th Mar 2008, 03:10 PM
themaManager - edit and manage...
Version 4.18 released. Open older version (or...