Re: I only want x number of lines of data

From: Date: Wed, 09 Aug 2006 15:44:23 +0000
Subject: Re: I only want x number of lines of data
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-240380@lists.php.net to get a copy of this message
On Wed, 2006-08-09 at 16:39 +0200, Jochem Maas wrote: > <? phpinfo(); ?>PROMISE<? phpinfo(); ?>TO<? phpinfo(); ?>STOP<? phpinfo(); > ?>BREAKING<? phpinfo(); ?>IN<? phpinfo(); > ?>AND<? phpinfo(); ?>OUT<? phpinfo(); ?>OF<? phpinfo(); ?>PHP<? > phpinfo(); ?>TO<? phpinfo(); ?>OUTPUT<? phpinfo(); > ?>STRINGS<? phpinfo(); ?>TO<? phpinfo(); ?>THE<? phpinfo(); ?>BROWSER<? > phpinfo(); > > <evil_grin>easy to read don't you think?</evil_grin> > > Ross wrote: > > At the mometn I have this > > > > > > function display_result($module_no) { > > > > if ($module_no != "") { > > $module_no =unserialize ($module_no); > > foreach ($module_no as $number => $data) { > > > > $count=$count+1;?> > > why $count when you already have $number And even if you really want to use $count, why not use the faster += operator: $count += 1; Or if 1 is always going to be your increment: $count++; Or if you know how ++ works and want to eke just a tad more speed out: ++$count; Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------'

« previous php.general (#240380) next »