//pre-calculate the size of array
$size = count($x); //or $size = sizeOf($x);
for ($i=0; $i<$size; $i++) {
//...
}
//don't pre-calculate
for ($i=0; $i<count($x); $i++) { //or $i<sizeOf($x);
//...
}
#Use Count Fn
.The sizeof() method takes a longer execution time.
.The sizeof() method is an alias of the count() method.
Code Example |
---|
Php :: laravel insert array |
Php :: laravel set a session variable |
Php :: image upload in laravel |
Php :: php clear cache |
Php :: laravel database seeder medium |
Php :: can we create linked list in php |
Php :: SPA and keep some of the Laravel pages you need to have a route like this |
Php :: explode with new line |
Php :: array pop php |
Php :: php comment |
Php :: hoew to store a cookie php |
Php :: replace key in php |
Php :: Only variables should be passed by reference in |
Php :: template literals php |
Php :: php session variables |
Php :: shortcode php wordpress |
Php :: install php apache |
Php :: set php var to html |
Php :: file upload codeigniter |
Php :: Php get all timezone |
Php :: php class extends exception |
Php :: php remove non utf-8 characters |
Php :: currency format in laravel |
Php :: php redirect with query string |
Php :: laravel create model |
Php :: php pdf |
Php :: laravel url download file |
Php :: wordpress is_tag function |
Php :: php disable buutton |
Php :: get all post |