by
6,450 24
4
6
345k
1
Top 1% !
Popular
Pearl of Wisdom
Tagged
Specified
OpenSource
Popularity: 2790th place

Published on:

php
Languagehandlebars
LanguagePHP
LicenseMIT_X11

Check if array is empty

this snippet checks if the $arrayToTest is empty
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/11269/Check-if-array-is-empty?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
<?php $ArrayToTest = array(''); $TestingArray = array_filter($ArrayToTest); if (!empty($TestingArray)) { echo "not empty"; } else { echo "empty"; } ?>
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus