//查找字符串
$str = 'What is your 我是name人';
$pos = mb_strpos($str,'name',0,'utf-8');
echo $pos;
$str = 'What is your 我是name人';
$pos = mb_strpos($str,'name',0,'utf-8');
echo $pos;
2015-10-13
class Car {
public $speed = 10;
public function __call($method,$args){
if ($method=='speedDown'){
$this->speed += -10;
}else{
echo '不存在'.$method.'這個方法';
}
}
}
$car = new Car();
$car->speedDown();
echo $car->speed;
public $speed = 10;
public function __call($method,$args){
if ($method=='speedDown'){
$this->speed += -10;
}else{
echo '不存在'.$method.'這個方法';
}
}
}
$car = new Car();
$car->speedDown();
echo $car->speed;
2015-10-12
最新回答 / 风中夜跑
if (!$stmt->execute()) { try{ throw new Exception('注册失败',ErrorCode::REGISTER_FAIL); } catch (Execption $e) { echo $e->getMessage(); }}求告知哪里的问题
2015-10-11
<?php
$str = '我需要安慰';//获取字符串长度
$ch = 'i need av';
$love = 'I love you';
$length_str = mb_strlen($str,"UTF8");
$length_ch = strlen($ch);
$length_love = strlen($love);
echo $length_str.'<br/>';
echo $length_ch.'<br/>';
echo $length_love;
?>
$str = '我需要安慰';//获取字符串长度
$ch = 'i need av';
$love = 'I love you';
$length_str = mb_strlen($str,"UTF8");
$length_ch = strlen($ch);
$length_love = strlen($love);
echo $length_str.'<br/>';
echo $length_ch.'<br/>';
echo $length_love;
?>
2015-10-10
这节给的文件路径本身就是错的"$filename = '/data/webroot/usercode/resource/test.txt';"应该是这个路径 $filename = '/data/webroot/usercode/code/resource/test.txt'; 结果少了个code 然后还要求读出来 能读出来才有鬼勒 直接输出还差不多
2015-10-10