In This PHP Tutorial We are going to learn how to remove duplicate values from array in PHP Programming Language. The PHP built in function array_unique use to remove duplicate values from a PHP array. The PHP array_unique function takes an array as the input and returns a new array without duplicate values.
In PHP array_merge() function is used to merge two or more arrays together. In This Example we have two PHP arrays, $color1 and $color2. And we Combined $color1 and $color2 using php array_merge function.
$color1=array('Red','Green','Blue'); $color2=array('White','Black'); $result=array_merge($color1,$color2); print_r($result);
In this PHP 7 Tutorial you are going to learn How to get Random Number in PHP 7.
PHP 7 has introduced a new built in function called random_int() which will generate the random number between given two integers.
PHP unset() function uses to remove element from array in PHP using array key. Example 1
$fruits=array('Apple','Mango',''Orange','Avacado','Banana'); unset($fruits); // Index 1 which is Mango will be removed from the PHP $fruits array print_r($fruits);
PHP Extract client information from the web server and stored in $_SERVER array. We can get the client IP address from the $_SERVER array by using "REMOTE_ADDR" argument.
$client_ip = $_SERVER["REMOTE_ADDR"]; echo $client_ip;