Re: [PHP] just 10 characters from a string From: * R&zE: (renze <email protected>)
Date: 08/31/01

<Original message>
From: Marcos Lloret <mlloret <email protected>>
Date: Fri, Aug 31, 2001 at 09:53:01AM +0200
Message-ID: <019701c131f1$f57bdfa0$371c94c1 <email protected>>
Subject: [PHP] just 10 characters from a string

> hi to all,
> i have a long string (about 255 characters) and i would like to show only 10. how can i do it?
>
> thanks in advance,
>
> marcos

</Original message>

<Reply>

When it's about _showing_ 10 characters, and not to change the
string itself:

$yourString = "abcdefghijklmnopqrstuvwxyz";
printf ("%.10s", $yourString);

</Reply>

-- 

* R&zE:

-- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renze <email protected> -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>