FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PHP Help
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: PHP Help [message #169892 is a reply to message #169890] Wed, 29 September 2010 13:20 Go to previous messageGo to previous message
rf is currently offline  rf
Messages: 19
Registered: September 2010
Karma:
Junior Member
"The Natural Philosopher" <tnp(at)invalid(dot)invalid> wrote in message
news:i7vcki$cqf$3(at)news(dot)albasani(dot)net...
> The Natural Philosopher wrote:
>> Captain Paralytic wrote:
>>> On 29 Sep, 03:39, John <ste...@sbcglobal.net> wrote:
>>>> I have a script that pulls a .txt file and displays the results for
>>>> me.
>>>
>>> What is the input? What are these "results"?
>>>
>>>> I need the scipt to limit the number of letters to not more than 15
>>>> letters, but not 15 letters exactly.
>>>
>>> This makes no sense at all. Please think about what it is you actually
>>> want and supply an example!
>>
>> sounds like a calassic truncation exercise.
>>
>> If lenth>15
>> then truncate to 15..
>>
>
> $trimmed=sprintf("%15s",$original);
>
> should do it, but I am rusty on printf..

Overkill.

$trimmed = substr($original,0,15);
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Learn Php In 17 Hours.
Next Topic: Can anyone recommend a good debugger & IDE for PHP?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 06:46:09 GMT 2024

Total time taken to generate the page: 0.04591 seconds