Re: [PHP] just 10 characters from a string

2001-08-31 Thread Alexander Skwar

So sprach »Marcos Lloret« am 2001-08-31 um 09:53:01 +0200 :
> i have a long string (about 255 characters) and i would like to show only 10. 
>how can i do it?

substr

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 2 days 1 hour 48 minutes

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] just 10 characters from a string

2001-08-31 Thread


From: Marcos Lloret <[EMAIL PROTECTED]>
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





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

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



-- 

* R&zE:


-- 
-- Renze Munnik
-- DataLink BV
--
-- E: [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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] just 10 characters from a string

2001-08-31 Thread Johan Vikerskog (ECS)

$string=abcdefghijklmnopqrstuvxyz
$string = substr($string, 0, 10);

Thats all there is to it.

-Original Message-
From: Marcos Lloret [mailto:[EMAIL PROTECTED]]
Sent: den 31 augusti 2001 09:53
To: [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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]