Re: just 10 characters from a string

From: Date: Fri, 31 Aug 2001 09:41:31 +0000
Subject: Re: just 10 characters from a string
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-65444@lists.php.net to get a copy of this message
<Original message> From: Marcos Lloret <mlloret@mail.fujitsu.es> Date: Fri, Aug 31, 2001 at 09:53:01AM +0200 Message-ID: <019701c131f1$f57bdfa0$371c94c1@mlloret> 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@datalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- ««««««««««««««««««««««««

« previous php.general (#65444) next »