__str__是什么函数
PHP str_shuffle()函数 (PHP str_shuffle() Function)
str_shuffle() function is a string function and it is used to shuffle all characters randomly in the string.
str_shuffle()函数是一个字符串函数,用于随机地随机排列字符串中的所有字符。
When this function executes, all time it returns shuffles string with random characters (characters from the given string).
执行此函数时,所有时间都会返回带有随机字符(给定字符串中的字符)的混洗字符串。
Syntax:
句法:
str_shuffle(string);
It accepts the string and returns shuffled string.
它接受字符串并返回改组后的字符串。
Examples:
例子:
Input:
$str = "This is IncludeHelp"
Output:
str_shuffle($str) = "enHeIdcupll"
str_shuffle($str) = "IcduneeplHl"
PHP code:
PHP代码:
<?php
$str = "IncludeHelp";
//printing shuffled string some of the times
echo (str_shuffle($str) . "\n");
echo (str_shuffle($str) . "\n");
echo (str_shuffle($str) . "\n");
echo (str_shuffle($str) . "\n");
echo (str_shuffle($str) . "\n");
$str = "ABC 123 @!#~&*()";
//printing shuffled string some of the times
echo (str_shuffle($str) . "\n");
echo (str_shuffle($str) . "\n");
echo (str_shuffle($str) . "\n");
echo (str_shuffle($str) . "\n");
echo (str_shuffle($str) . "\n");
?>
Output
输出量
enHeIdcupll
IcduneeplHl
eenulHpcIld
enucIHepdll
ldIlceeupHn
2~B*()@# !3A1& C
@C&(#)12*~!3BA
@* &2CA( !~31#)B
B!2C1~([email protected] A*)
&A ~3 (CB2!)@1*#
翻译自: https://www.includehelp.com/php/str_shuffle-function-with-example.aspx
__str__是什么函数