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 #169901 is a reply to message #169890] Wed, 29 September 2010 16:26 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 9/29/2010 8:49 AM, The Natural Philosopher wrote:
> 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..

Which doesn't work, because the %15 is the minimum length of the string
- not the maximum.

A typical TNP response.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[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: Sat Nov 30 10:09:22 GMT 2024

Total time taken to generate the page: 0.04223 seconds