English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP String Character String Functions Manual
The str_shuffle() function is used to randomly shuffle the order of the string.
string str_shuffle ( string $str )
It is used to randomly shuffle the string
It returns the shuffled string
Serial Number | Parameter and Description |
---|---|
1 | string Input String |
Try the following example, randomly shuffle all characters in the string and shuffle all the digits in order:
<?php //Randomly shuffle all characters in the string $input = 'abcdefphp_function_str_shuffle www.oldtoolbag.com'; $shuffled = str_shuffle($input); echo $shuffled; echo '<br>'; //Randomly shuffle the digits $number=123456789; $shuffled_number = str_shuffle($number); echo $shuffled_number; ?>Test and see‹/›
nfcwfwoccwmlfhnhhr aisupottpf.uo_o_e_sod.ebn 534672819PHP String Character String Functions Manual