Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51768 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5937 invoked from network); 31 Mar 2011 15:36:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Mar 2011 15:36:52 -0000 Authentication-Results: pb1.pair.com header.from=martinscotta@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=martinscotta@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: martinscotta@gmail.com X-Host-Fingerprint: 209.85.212.42 mail-vw0-f42.google.com Received: from [209.85.212.42] ([209.85.212.42:56318] helo=mail-vw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 88/66-04048-39F949D4 for ; Thu, 31 Mar 2011 10:36:51 -0500 Received: by vwl1 with SMTP id 1so2152639vwl.29 for ; Thu, 31 Mar 2011 08:36:48 -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; bh=tZLYnlZIcsB5XdcmWqe/ZDM7k6z6glIKPWyrmEQ+JAY=; b=J8Bh+gBVeneD+ZcUGD4x1QKLhXG0V1zISjxmzlfqn56rb5OkgzCfc+Han0uGqkwWHQ qwSJXbEaOqkRaA7m1r45I94ioksm3yS/AztO0UOgNjKMJCH+hkk1S+RudAVFGARG7y8X bDV1NxvcH0D/nJw9iCEJI0giF4N9yLq8yiBlw= 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; b=o74yvNWDtm8pgJvDCZUDPpzhFr3ANMLjFkmu1e1z26j0fWwP6I7GJSgI2A7hgHekLf EgTHqB+T/QbguqT5DcaTxzHgb4sZXAFRpDT8K0E/kk8rko71VkY2p6BlSN4EUvqW0DeD Wz7n7jF2MlPs3btXHhwEMZwl6yyP/56t+nfzo= MIME-Version: 1.0 Received: by 10.52.71.228 with SMTP id y4mr3881003vdu.28.1301585808598; Thu, 31 Mar 2011 08:36:48 -0700 (PDT) Received: by 10.220.176.199 with HTTP; Thu, 31 Mar 2011 08:36:48 -0700 (PDT) In-Reply-To: <4D94984D.8060700@lerdorf.com> References: <4D92CC38.5040900@toolpark.com> <004301cbeee8$e54a8280$afdf8780$@com> <4D9387BE.4030808@divbyzero.net> <4D94984D.8060700@lerdorf.com> Date: Thu, 31 Mar 2011 12:36:48 -0300 Message-ID: To: Rasmus Lerdorf Cc: Philip Olson , Martin Jansen , Dan Birken , internals@lists.php.net Content-Type: multipart/alternative; boundary=20cf307d0436c4265b049fc90f2a Subject: Re: [PHP-DEV] Adding a more logical string slicing function to PHP From: martinscotta@gmail.com (Martin Scotta) --20cf307d0436c4265b049fc90f2a Content-Type: text/plain; charset=ISO-8859-1 Martin Scotta On Thu, Mar 31, 2011 at 12:05 PM, Rasmus Lerdorf wrote: > On 03/31/2011 07:41 AM, Philip Olson wrote: > > > > On Mar 30, 2011, at 1:42 PM, Martin Jansen wrote: > > > >> On 30.03.11 21:36, Dan Birken wrote: > >>> As for adding other string functions, I agree, I think there are a lot > of > >>> them that would be great to add. starts_with & ends_with for sure. > >> > >> Both str_startswith and str_endswith have been suggested in the past: > >> > >> http://marc.info/?t=121647230100001&r=1&w=2 > >> > >> I recently got around to merge them into a largely unfinished extension > >> so they are archived somewhere safe: https://github.com/mj/php-ext-str > > > > I see str_contains() on the TODO there. I've always wanted in_string() so > am glad to see a similar item. Using strpos() for this task feels dirty, > much like using arrpos() for arrays would ;) > > How would str_contains() be different from strstr()? > > They differ in the return type boolean str_contains(string, string); string strstr(string, string); -Rasmus > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --20cf307d0436c4265b049fc90f2a--