把格式化字符串写入变量中:
<?php
$number = 9;
$str = "Beijing";
$txt = vsprintf("There are %u million bicycles in %s.",array($number,$str));
echo $txt;
?>
var_export — 输出或返回一个变量的字符串表示
public function dump($key, $data) {
$contents = '<?php' . "\n" . '$config = ' . var_export($data, true) . ';';
$filename = $this->_getFilePath($key);
return file_put_contents($filename, $contents);
}
-----------------------------------------------------------------------------
if else if就是这样的,满足if则不会走else if
如果你想要满足,写成
if(){
}
if(){
}
即可,不要那个else