choose a random word from an array php
<?php
//array_rand ( array $array [, int $num = 1 ] )
$input = array("Neo", "Morpheus", "Trinity", "Cypher", "Tank");
$rand_keys = array_rand($input, 2);
echo $input[$rand_keys[0]] . "\n";
echo $input[$rand_keys[1]] . "\n";
?>
$items = array(1, 2, 3, 4, 5);
echo $items[array_rand($items)];
Also in PHP:
- display errors off php
- cech error in php
- Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
- create an exception php
- check if string cotains php
- check chartercount in php
- current domain in php
- check where key in associative array have a value
- display current data php
- PHP 7.2 extension ext-dom
- date add in php days
- datetime object to string php
- array_values() in php
- days or month php api format
- clear cache in laravel in windows cmd
- Decode from Base64 format php
- filegetcontent php ssl
- date time pph
- check if substring is in string php
- disable php errors
- What parameter should you enable if you wish for your browser to show all errors?
- "array_key_exists(): + file array laravel
- echo errors of php
- console log json php