Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php how to count array

$array = ['x', 'y', 'z'];
count($array); // output 3
sizeof($array); // output 3
Comment

count an array in php

<?php
 $vegetables = ["Cabbage", "Carrot", "Lettuce"];
 $arrayLength = count($vegetables);
 echo $arrayLength; //returns 3
?>
Comment

get count array php

$days = array("Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat");
 
// Printing array size
echo count($days);
echo "<br>";
echo sizeof($days);
Comment

PREVIOUS NEXT
Code Example
Php :: show php info 
Php :: php remove slash from string 
Php :: php escape special characters 
Php :: php sum array elements 
Php :: php code to hide plugin update for wordpress 
Php :: for loop php increment by 2 
Php :: laravel permission denied storage log 
Php :: php add year to date 
Php :: laravel pluralization text 
Php :: add to url anchor tag laravel with variable 
Php :: add dd function composer 
Php :: laravel abort 
Php :: laravel upload image to public folder 
Php :: php if string is already in database 
Php :: header.php file how to fetch in index.php file in wordpress 
Php :: post thumbnail 
Php :: php switch 2 variables 
Php :: laravel get extension from url 
Php :: php date format 
Php :: php check internet connection 
Php :: php check if its a name 
Php :: display summernonte data with string limit laravel 
Php :: erd in phpmyadmin 
Php :: showing database table in php 
Php :: add new column to table laravel 
Php :: laravel_8 
Php :: mobile number validation in laravel 8 
Php :: laravel migrate fresh 
Php :: laravel whereraw 
Php :: access config variable in codeigniter controller 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =