Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:53438 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52896 invoked from network); 20 Jun 2011 17:28:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Jun 2011 17:28:17 -0000 Authentication-Results: pb1.pair.com header.from=ircmaxell@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=ircmaxell@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.83.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: ircmaxell@gmail.com X-Host-Fingerprint: 74.125.83.170 mail-pv0-f170.google.com Received: from [74.125.83.170] ([74.125.83.170:32944] helo=mail-pv0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 59/01-34681-0338FFD4 for ; Mon, 20 Jun 2011 13:28:17 -0400 Received: by pvh10 with SMTP id 10so4016878pvh.29 for ; Mon, 20 Jun 2011 10:28:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=FIgyqQzYpc0NILafLtyXkHNu7GIz1d1QBGXDGbgzOOk=; b=Ep0SECLycIqIaJeLcD2bnCDKs4jtpW88eM8L1g+TrH7YQ8gRMk+qMO2pJmag2uN8ZM rJuIdRfo4gLjebT2hO/3O7yGMM8QoO1BKeC0/nQVymCQZlFrk3U7srO46N+t+rEjJiUm f8/1SVLJ1P5rPnRPOZ1UYoLbyQ5u8Df1Ysg6A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=EA1eIrLoHiuUGXz7CAXKf/5lnReXaPJTr5LsLh4efMcTXWFeNbZD+s6ZsbeYLRv3Xs KP6laNg0cRpt22bZmHQ7JkkxOa4mfWfEOTyUNgQNCCNrVt1GcK6voSlVtNzRfGDnUiKq GZvtTJPeQJVJQgyWxa7EtD7ehJeeDYNjMYiYg= MIME-Version: 1.0 Received: by 10.68.35.165 with SMTP id i5mr2077990pbj.449.1308590893709; Mon, 20 Jun 2011 10:28:13 -0700 (PDT) Received: by 10.68.56.104 with HTTP; Mon, 20 Jun 2011 10:28:13 -0700 (PDT) In-Reply-To: <4DFF7E2A.50506@sugarcrm.com> References: <1308584208.6296.9.camel@guybrush> <1308586150.6296.13.camel@guybrush> <1308589044.8394.27.camel@inspiron> <4DFF7E2A.50506@sugarcrm.com> Date: Mon, 20 Jun 2011 13:28:13 -0400 Message-ID: To: Stas Malyshev Cc: Todd Ruth , "internals@lists.php.net" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: foreach() for strings From: ircmaxell@gmail.com (Anthony Ferrara) > text_to_array($s) =3D=3D str_split($s, 1) No, because str_split always splits into 1 byte chunks. text_to_array would take the character set into account (or that's where the utility in it would be)... On Mon, Jun 20, 2011 at 1:06 PM, Stas Malyshev wro= te: > Hi! > > On 6/20/11 9:57 AM, Todd Ruth wrote: >> >> Iterators are nice. =A0Having a "text_string_to_array" function >> would also be fine. =A0For example: >> >> $s =3D 'hello'; >> foreach (text_string_to_array($s) as $x) { >> =A0 =A0 var_dump($x); >> } > > > text_to_array($s) =3D=3D str_split($s, 1) > > -- > Stanislav Malyshev, Software Architect > SugarCRM: http://www.sugarcrm.com/ > (408)454-6900 ext. 227 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >