[pLog-svn] r4693 - plog/branches/lifetype-1.2/class/net/http/session

Matt Wood matt at woodzy.com
Mon Feb 5 18:02:32 EST 2007


ugh. I'm an iddiot. Reading top down or something.

On 2/5/07, Matt Wood <matt at woodzy.com> wrote:
>
> preg_replace take significantly more time (and memory) to execute than
> str_replace... just wondering what your rationale for this was...
>
> From PHP Website:
> mixed *str_replace* ( mixed search, mixed replace, mixed subject [, int
> &count] )
> This function returns a string or an array with all occurrences of *search
> * in *subject* replaced with the given *replace* value. If you don't need
> fancy replacing rules (like regular expressions), you should always use this
> function instead of ereg_replace()<http://hu.php.net/manual/en/function.ereg-replace.php>or
> preg_replace() <http://hu.php.net/manual/en/function.preg-replace.php>.
>
> On 2/5/07, oscar at devel.lifetype.net <oscar at devel.lifetype.net> wrote:
> >
> > Author: oscar
> > Date: 2007-02-05 17:15:16 -0500 (Mon, 05 Feb 2007)
> > New Revision: 4693
> >
> > Modified:
> >    plog/branches/lifetype-1.2
> > /class/net/http/session/sessionmanager.class.php
> > Log:
> > Added Jon's fix
> >
> >
> > Modified: plog/branches/lifetype-1.2
> > /class/net/http/session/sessionmanager.class.php
> > ===================================================================
> > --- plog/branches/lifetype-1.2/class/net/http/session/sessionmanager.class.php  2007-02-05
> > 21:49:03 UTC (rev 4692)
> > +++ plog/branches/lifetype-1.2/class/net/http/session/sessionmanager.class.php  2007-02-05
> > 22:15:16 UTC (rev 4693)
> > @@ -104,7 +104,7 @@
> >                                 $scriptUrl = HttpVars::getBaseUrl();
> >
> >                         $url = new Url( $scriptUrl );
> > -                       $domain = str_replace( "www.", ".",
> > $url->getHost());
> > +                       $domain = preg_replace("/^www\./", ".",
> > $url->getHost());
> >
> >                         // this won't work for top level domains and
> > domains such as
> >                         // 'localhost' or internal domains for obvious
> > security reasons...
> >
> > _______________________________________________
> > pLog-svn mailing list
> > pLog-svn at devel.lifetype.net
> > http://limedaley.com/mailman/listinfo/plog-svn
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://limedaley.com/pipermail/plog-svn/attachments/20070205/f6f403b1/attachment.htm 


More information about the pLog-svn mailing list