background image

        $newstr .= $str{$i};

}

    return $newstr;

}

15.实现中文字串截取无乱码的方法。

答:mb_substr()

16.使用 php

写一段简单查询,查出所有姓名为 张三 的内容并打印出来

表名 User

Name          Tel              Content         Date

张三        13333663366        大专毕业       2006-10-11

张三        13612312331        本科毕业       2006-10-15

张四        021-55665566       中专毕业       2006-10-15

答:SELECT Name,Tel,Content,Date FROM User WHERE Name='张三'

17.如何使用下面的类,并解释下面什么意思?

class test

{

    Get_test($num)

{       $num=md5(md5($num)."En");

        return $num;

    }

}

答:用法:

$get_test = new test();

$result = $get_test->Get_test(2);