發(fā)現(xiàn)King老師的課很喜歡之后,就想全看一遍,回顧一下基礎(chǔ),非常感謝老師,老師思路很清晰,細(xì)節(jié)也全講到了
2017-10-22
<meta charset="utf-8">
<?php
echo $str = <<< DOC
<table border="1">
<tr>
<th>姓名</th>
<th>班級(jí)</th>
<th>年齡</th>
</tr>
<tr>
<td>張三</td>
<td>三年二班</td>
<td>12</td>
</tr>
<tr>
<td>李四</td>
<td>六年一班</td>
<td>11</td>
</tr>
</table>
DOC;
?>
<?php
echo $str = <<< DOC
<table border="1">
<tr>
<th>姓名</th>
<th>班級(jí)</th>
<th>年齡</th>
</tr>
<tr>
<td>張三</td>
<td>三年二班</td>
<td>12</td>
</tr>
<tr>
<td>李四</td>
<td>六年一班</td>
<td>11</td>
</tr>
</table>
DOC;
?>
2017-10-10
<?php
$str ='abcdefghijklnmopqrstuvwxyzABCDEFGHJIKLMNOPQRSTUVWXYZ0123456789';
$string=null;
for ($i=0; $i <4 ; $i++){
$string.= $str[mt_rand(0,strlen($str)-1)];
}
echo $string;
echo '<br/>';
echo strlen($str);
?>
$str ='abcdefghijklnmopqrstuvwxyzABCDEFGHJIKLMNOPQRSTUVWXYZ0123456789';
$string=null;
for ($i=0; $i <4 ; $i++){
$string.= $str[mt_rand(0,strlen($str)-1)];
}
echo $string;
echo '<br/>';
echo strlen($str);
?>
2017-10-10
真實(shí)項(xiàng)目中驗(yàn)證碼可別這么干,要服務(wù)端生成,接收到的和服務(wù)器生成的對(duì)比
2017-09-06
// 隨機(jī)輸出4位由數(shù)字、大小寫字母組成的字符
function str_random() {
$str = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
for ($i=0;$i<4;$i++) {
echo $str{mt_rand(0,strlen($str)-1)};
}
}
str_random();
function str_random() {
$str = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
for ($i=0;$i<4;$i++) {
echo $str{mt_rand(0,strlen($str)-1)};
}
}
str_random();
2017-09-01