Re: Variable Troubleshooting Code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/09/2012 07:16 PM, Donovan Brooke wrote:
Just to share, a Mr. Harkness forwarded me a consolidated version of my
code.. basically substituting the innards for:


if (!isset($pmatch) || substr($key,0,strlen($pmatch)) == $pmatch) {
print "$key = $value<br />";
}


Cheers,
Donovan




I would change the above the the following:

if ( empty($pmatch) || ( strpos($key, $pmatch) === 0 ) ) {
  print "$key = $value<br />";
}

it would be slightly faster

--
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/
http://www.bendsource.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux