六间房的两个php面试题
<?php
/*=============================================================================
# FileName: base64.php
# Desc: 六间房笔试题一:读取一个文件,将其Base64编码,每76个字符加一个换行
# Author: HouYongZheng
# Time: 2013-05-20 14:25
=============================================================================*/
header('Content-Type: text/html; charset=utf-8');
$body=file_get_contents('base64.txt');
$base_body=base64_encode($body);
$count=1;
for($i=0;$i
<?php
/*=============================================================================
# FileName: array.php
# Desc: 六间房笔试题二:写一个函数,参数为$n,生成一个数组,其元素为1~$n,各元素位置随机排列,不得重复
# Author: HouYongZheng
# Time: 2013-05-20 15:01
=============================================================================*/
function rand_array($n){
$array=array();
$rand_array=array();
for($i=1;$i<=$n;$i++){
array_push($array,$i);
}
//return $array;
for($i=0;$i
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号