Array is kind of data structure where it stores multiple values in a single variable. you can save multiple values like in a stack by using arrays. define array in php as follows.
$arrayExample = array( value1,value2,value3);
example:
$x = array(10,20,30);
$x=array();//empty array
array_push($x,1,2);
print_r($x);
output: Array ( [0] => 1 [1] => 2 )
$numberArray = array( 10, 20, 30);
foreach( numberArray as $readvalue ) {
print_r($readvalue);
}
$string = "number1,number2,number3";
$expldedArray = explode(",",$string);
the above example, $explodedArray has 3 elements where $string breaks by comma.
$string = “tec.icrony.net“;
echo trim($string,“tec..net“);//remove from both sides and returns icrony
echo ltrim($string,“tec.“);//returns icrony.net
echo rtrim($string,“.net“);//returns tec.icrony
$string = “tec.icrony.net“;
echo substr($string,4,6);//return icrony
for more you can refer here