PHP array string functions are some of the most important functions you need to know in PHP if you want to become an efficient programmer. In this tutorial, we will look at the most commonly used array string functions, including (but not limited to) count, push, in_array, asort, and pop.
PHP arrays are a simple way of storing numerous bits of information (such as strings) in a simple PHP variable, known as an “array variable”; you can retrieve this information by using its key index.
On the other hand, “strings” are a finite series of symbols from a set such as an alphabet. In PHP, you can designate a string with single or double quotes:
$string1= 'This is a string created by single quote';
$string2= "This is a string created by double quotes";
Most of the information you gather in a PHP web form is in string data format. Storing strings in an array allows your code to use only a single PHP variable to store a lot of information. Supposing you would like to define an array variable that consist of the planets in the solar system, you would do so in the following manner:
//create an array variable $planets
//store strings in the $planet array variable, which is essentially the name of the planets
//dump all string information stored in the array variable to the browser
The numbers  to  are the key index values corresponding to each piece of string information stored in the array. You can retrieve string information by calling its key. Supposing you will need to retrieve the planet “Jupiter”, the index key is 4:
There are also “associative arrays”, which are useful if you do not use a sequential numerical key index for your string elements. For example:
//Example1. Associative array of a person and its favorite pet
//Example2. Associative array of a person and its weight in kilos
Below is the output of the above associative array: