Ternary Operator in PHP – Explained

If you don’t know what’s a ternary operator in PHP is, then you’re missing a cool feature of PHP. There are few operators in PHP which seems a bit complicated. Ternary Operator is one of them. The reason it’s called ternary operator is exactly what you are thinking, it’s composed of three operands. (Operands are

Loops in PHP – Explained

Loops in PHP allow us to repeat code until certain condition is met. A loop will go round and round and round multiple times executing the code until certain conditions are met. Very similar to the conditional statements but more powerful. There are four PHP looping statements. while – loops through a code block as

Conditional Statements in PHP

PHP allows us to perform actions based on different conditions. This means we can create conditions that evaluates to either true or false and based on that result we can perform certain actions. These are called Conditional Statements. Conditional Statements are also known as – conditional expressions or conditional constructs. Conditional Statements in PHP There are few conditional

Use array_column() to Get Values from Multidimensional Arrays

Previously we saw how we can create Multidimensional Arrays. Now we’ll see how we can get specific key, values from multidimensional arrays using the array_column() function. The array_column() function fetches the values from a single column in the input array. We have to specify the array we are going to use and the column_key (An

Multidimensional Arrays in PHP

In my previous post, I discussed about arrays in PHP. Arrays can contain multiple values at a time. Arrays can also contain other arrays inside them. When you create arrays inside another array, that’s a multidimensional array. Multidimensional arrays can be two-dimensional, three-dimensional or more. But it gets a little complicated if you create a bigger one.