Category Archives for PHP

Arrays in PHP

Arrays are variables with a super power. While an ordinary variable can contain a single value, an array can contain multiple values at a time. Previously, when we discussed data types in PHP, we saw that booleans, integers, floats – these can represent only one value at a time. But arrays can contain more than […]

Continue reading

PHP Data Types at A Glance

PHP supports specific data types. You can’t just use anything within PHP scripts. In this post, I will discuss the data types which PHP supports and you can use. Basically PHP supports eight types of data. These data types are categorized into Scalar types, Compound types and special types. First, let’s check the Scalar types. […]

Continue reading

How to Connect a MySQL Database with PHP

If you want to fetch information from database or insert information to a database using PHP, first you need to establish a connection between MySQL database and PHP. You can easily manipulate databases from your PHP scripts once you have connected them. Here  I will show you, how you can connect your MySQL database with […]

Continue reading

How to use array_shift() Function in PHP

array_shift function is used to shift or remove the first value of an array. Here’s an example : Output will look like this : Array ( [0] => The Doors [1] => Dire Straits [2] => Simon and Garfunkel ) The first value from the array is removed. You can assign the removed value to […]

Continue reading