目前分類:Programming (467)
- Aug 25 Thu 2022 16:11
[轉] 破解痞客邦 pixnet 複製/貼上/鎖右鍵
- May 23 Mon 2022 16:10
[PHPExcel] PHPExcel套用儲存格格式
- May 23 Mon 2022 16:05
[PHP] “excel date format in php” Code Answer
- May 10 Tue 2022 15:38
[Postman][轉] 在 Postman 使用 CSV 一次完成相同欄位但不同資料的 Request
這一篇記錄的是 在 Postman 使用 CSV 一次完成相同欄位但不同資料的 Request,還有如果資料讀取的內容全是數字時建議應該如何做
- May 07 Sat 2022 16:18
[轉][Notepad++] notepad++ 中文亂碼 出現小方格 問號???等問題
- Apr 27 Wed 2022 16:31
[PhpSpreadsheet] Drawing 文件
- Apr 27 Wed 2022 16:11
[PHPExcel] PHP Excel image change size
$objDrawing->setWidthAndHeight(148,74); // 長,寬
$objDrawing->setResizeProportional(true); // 是否維持原比例縮放,預設true,如果要自訂比例則這個參數要帶入false
--
- Apr 22 Fri 2022 16:30
[轉]【Google 試算表】自動抓取股價資料,就用 GoogleFinance 搞定!
- Apr 22 Fri 2022 16:04
[轉][Google試算表] Googlefinance及時匯率
- Apr 20 Wed 2022 14:25
[dataTable] dataTable給欄位預設值 columns.defaultContent
- Apr 06 Wed 2022 17:15
[PHPWord] PHPWord Template too slow after 100 record
通常使用PHPWord template,要增加一連串的列表資料時,先cloneRow目標列,再使用setValue把列表資料填進去
https://phpword.readthedocs.io/en/latest/templates-processing.html
- Jan 31 Mon 2022 00:35
[轉] 5 個免費 Bilibili 影片下載免安装線上工具推薦!
- Jan 20 Thu 2022 14:23
[轉] Google 試算表【下拉式選單】怎麼做?資料驗證2招用起來!
- Jan 05 Wed 2022 14:17
[PHP][轉] PHP File Create/Write - PHP建立檔案/寫入檔案
<?php
$myfile = fopen("newfile.txt", "w") or die("Unable to open file!"); // 建立檔案
- Dec 22 Wed 2021 14:19
[Word] Word「第幾頁,共幾頁」選項怎麼不見了? 其實在這裡啦~~
功能表列選擇 [插入] → [頁碼] 點進去
不管是點選頂端或是底端,很多人只看到4或5個選項,就想說那我要「第幾頁,共幾頁」是要怎麼設定,其實都沒注意到旁邊有捲軸可以往下拉,往下捲動有很多樣式可以選喔~
- Dec 21 Tue 2021 17:06
[PHP][轉] 小數點不足補零
參考網址:
http://fanli7.net/a/bianchengyuyan/PHP/20100930/40653.html
http://blog.hsin.tw/2009/php-pad-a-string/
最近做了一個案子非台幣為貨幣,因此會有小數點的問題。
我想實作出紙個網站是統一格式。
例:
$85.5統一顯示$85.50
$80統一顯示$80.00
但php 直接 echo 卻無法呈現我想要的效果
他只會顯示85.5.......這不是我要的阿...
於是爬了文找到補零方法
我的需求是要做到小數二位數因此要這麼做..
$money=85.5
echo sprintf(”%01.2f”,$money); //會印出85.50
成功!!
相關文章:
--
- Dec 16 Thu 2021 14:15
[Laravel] Use static variables in Laravel
- Dec 14 Tue 2021 15:48
[PHP][轉] 幾行代碼輕鬆實現PHP文件打包下載zip
- Dec 01 Wed 2021 16:18
[dataTable][轉] How to Export Multiple Row Headers in jQuery Datatables?
- Dec 01 Wed 2021 11:23
[PHP][轉] strpos — 查找字符串首次出现的位置
[php]strpos — 查找字符串首次出现的位置
官方範例1
<?php
$mystring = 'abc';
$findme = 'a';
$pos = strpos($mystring, $findme);
// 注意這裡使用的是 ===。簡單的 == 不能像我們期待的那樣工作,
// 因為 'a' 是第 0 位置上的(第一個)字符。
if ($pos === false) {
echo "The string '$findme' was not found in the string '$mystring'";
} else {
echo "The string '$findme' was found in the string '$mystring'";
echo " and exists at position $pos";
}
?>
官方範例2
<?php
$mystring = 'abc';
$findme = 'a';
$pos = strpos($mystring, $findme);
// 使用 !== 操作符。使用 != 不能像我們期待的那樣工作,
// 因為 'a' 的位置是 0。語句 (0 != false) 的結果是 false。
if ($pos !== false) {
echo "The string '$findme' was found in the string '$mystring'";
echo " and exists at position $pos";
} else {
echo "The string '$findme' was not found in the string '$mystring'";
}
?>
官方範例3
<?php
// 忽視位置偏移量之前的字符進行查找
$newstring = 'abcdef abcdef';
$pos = strpos($newstring, 'a', 1); // $pos = 7, 不是 0
?>
--