[linux-programlama] Re: substr fonksiyonu

---------

New Message Reply About this list Date view Thread view Subject view Author view

From: Enver ALTIN (ealtin@casdb.com)
Date: Thu 23 Jan 2003 - 23:00:26 EET


Merhaba,

On Thu, 2003-01-23 at 12:04, Murat Çetiin wrote:
> for ($i=0;$i<strlen($message);$i=$i+1500){
> echo "<br>".substr($message,$i,1500);
> }

ipucu:

for ($=0; $i<strlen($message); $i+=1500)
        echo substr($message,$i,1500);

tek satirlik bir blok icin curly braces {} kullanmaniza gerek yok ve +=,
.= gibi operatorler hayatimizi kolaylastirabilir.

Bir de, chunk_split() fonksiyonu:

echo chunk_split($message, 1500, "<br>\n");

her 1500 byte araya <br> ve bir newline (\n) ekleyecektir. Dongu metodu
biraz daha hizli ve bellek dostu olsa gerek.

--
Enver ALTIN (a.k.a. skyblue)      - Software developer, generic solvent
http://enver.casdb.com            - mailto: ealtin at casdb dot com
http://enver.casdb.com/CV.html    - Just me, myself and I.

"My doctor told me to stop having intimate dinners for four. Unless there are three other people." -- Orson Welles

-- Attached file included as plaintext by Ecartis -- -- File: signature.asc -- Desc: This is a digitally signed message part

-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (GNU/Linux)

iD8DBQA+MFfppnqewlhW/m4RAjg8AJ4vhY+spg837D/rGQUwj0AZVpRUwwCeNUZb Z/eYQEubmCTXBVSTDfaTEMs= =E/aD -----END PGP SIGNATURE-----


New Message Reply About this list Date view Thread view Subject view Author view

---------

Bu arsiv hypermail 2b29 tarafindan uretilmistir.