Re: [請益] 如何印出空格?
※ 引述《eco100 (Maktub)》之銘言:
: 不好意思 初學者問一個蠢問題
: 就是我要 echo 一個字串前
: 要先 echo 空格 但是空格的數量也是一個變數
: 不知道要怎麼寫 有人可幫忙嗎? 謝謝
/**
* Repeater function
*
* @access public
* @param string
* @param integer number of repeats
* @return string
*/
if ( ! function_exists('repeater'))
{
function repeater($data, $num = 1)
{
return (($num > 0) ? str_repeat($data, $num) : '');
}
}
repeater(" ", $num);
--
PHP MVC CodeIgniter 繁體中文手冊: http://tinyurl.com/mduyv8
PHP MVC CodeIgniter 繁體中文討論區:http://tinyurl.com/yayzoz8
PHP MVC CodeIgniter 中文官方網站: http://tinyurl.com/yatds8n
Appleboy Blog 電腦技術: http://blog.Wu-Boy.com
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.123.116.151
→
06/03 00:27, , 1F
06/03 00:27, 1F
→
06/03 12:02, , 2F
06/03 12:02, 2F
討論串 (同標題文章)
PHP 近期熱門文章
PTT數位生活區 即時熱門文章