zoukankan      html  css  js  c++  java
  • php中函数 vsprintf() 和 var_export()

    把格式化字符串写入变量中:

    <?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' . "
    " . '$config = ' . var_export($data, true) . ';';
    
    		$filename = $this->_getFilePath($key);
    		return file_put_contents($filename, $contents);
    	}
    

      -----------------------------------------------------------------------------

    if else if就是这样的,满足if则不会走else if

    如果你想要满足,写成
    if(){

    }

    if(){

    }
    即可,不要那个else
  • 相关阅读:
    LibreOJ2302
    POJ3693
    BZOJ3697
    BZOJ2599
    BZOJ2152
    BZOJ1468
    BZOJ4653
    BZOJ4553
    BZOJ4552
    BZOJ4551
  • 原文地址:https://www.cnblogs.com/oxspirt/p/6278372.html
Copyright © 2011-2022 走看看