Last Updated: February 25, 2016
·
1.686K
· rican7

PHP Array Empty?

This is good to know.

Essentially, an array with a single, null value isn't "empty"

However, an array with no keys/values is considered both "empty" and null (loosely).

1 Response
Add your response

@mbarzda exactly. Simple to understand, but I can understand how it would trip someone up if they haven't run into it before.

over 1 year ago ·

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Did you know?

PHP applications still send a browser full of JavaScript. Hardening the server does not inventory the payment, analytics, and plugin scripts that run after the HTML is delivered.

Security insights from Cside