Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53505 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82289 invoked from network); 22 Jun 2011 12:14:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Jun 2011 12:14:44 -0000 Authentication-Results: pb1.pair.com smtp.mail=glopes@nebm.ist.utl.pt; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=glopes@nebm.ist.utl.pt; sender-id=unknown Received-SPF: error (pb1.pair.com: domain nebm.ist.utl.pt from 193.136.128.21 cause and error) X-PHP-List-Original-Sender: glopes@nebm.ist.utl.pt X-Host-Fingerprint: 193.136.128.21 smtp1.ist.utl.pt Linux 2.6 Received: from [193.136.128.21] ([193.136.128.21:53507] helo=smtp1.ist.utl.pt) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 93/70-12605-0BCD10E4 for ; Wed, 22 Jun 2011 08:14:41 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp1.ist.utl.pt (Postfix) with ESMTP id 1ADC1700048C for ; Wed, 22 Jun 2011 13:14:37 +0100 (WEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at ist.utl.pt Received: from smtp1.ist.utl.pt ([127.0.0.1]) by localhost (smtp1.ist.utl.pt [127.0.0.1]) (amavisd-new, port 10025) with LMTP id hjf4voXdyet1 for ; Wed, 22 Jun 2011 13:14:36 +0100 (WEST) Received: from mail2.ist.utl.pt (mail.ist.utl.pt [IPv6:2001:690:2100:1::8]) by smtp1.ist.utl.pt (Postfix) with ESMTP id DD6E7700048B for ; Wed, 22 Jun 2011 13:14:36 +0100 (WEST) Received: from clk-0081.mshome.net (unknown [85.139.253.17]) (Authenticated sender: ist155741) by mail2.ist.utl.pt (Postfix) with ESMTPSA id BE6B22009905 for ; Wed, 22 Jun 2011 13:14:36 +0100 (WEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: internals@lists.php.net References: <4DFF7A12.8060808@sugarcrm.com> <4E00818C.7040201@lsces.co.uk> <4E008EA3.4000403@lsces.co.uk> <41269.5975f3c3.1308671739.nsm@avilys.eik.lt> <4E00C370.9040803@thelounge.net> <4E00C5D0.9020302@thelounge.net> <57392.5975f3c3.1308676323.nsm@avilys.eik.lt> <4E00DA33.9040504@thelounge.net> <58008.5975f3c3.1308687593.nsm@avilys.eik.lt> <4E00FEAC.3040500@thelounge.net> <52139.5975f3c3.1308720282.nsm@avilys.eik.lt> <4E01CEA0.2090607@thelounge.net> Date: Wed, 22 Jun 2011 13:14:35 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable Organization: =?utf-8?Q?N=C3=BAcleo_de_Eng=2E_Biom=C3=A9di?= =?utf-8?Q?ca_do_I=2ES=2ET=2E?= Message-ID: In-Reply-To: <4E01CEA0.2090607@thelounge.net> User-Agent: Opera Mail/11.11 (Win32) Subject: Re: [PHP-DEV] foreach() for strings From: glopes@nebm.ist.utl.pt ("Gustavo Lopes") Em Wed, 22 Jun 2011 12:14:40 +0100, Reindl Harald = escreveu: > Am 22.06.2011 07:24, schrieb Tomas Kuliavas: >> 2011.06.21 23:27 Reindl Harald ra=C5=A1=C4=97: >>> i do not understand any word and miss a simple str_is_utf8() >> >> Such function uses six lines in PHP. > > so why do you not post them?t > It's actually 3 lines: function str_is_utf8($str) { return $str =3D=3D "" || htmlspecialchars($str, 0, "UTF-8"); } or function str_is_utf8($str) { return preg_match('//u', $str) !=3D=3D false; } But I agree it wouldn't hurt to have a str_is_utf8. -- = Gustavo Lopes