PHP 多檔案上傳

name 設為[]陣列 ,並在後方加上 multiple

<input type="file" name="userImage[]" id="userImage" multiple>

上傳處理

foreach( $_FILES[userImage][tmp_name] AS $k => $v){
	if(is_uploaded_file($_FILES['userImage']['tmp_name'][$k])) {
		$source_file = $_FILES['userImage']['tmp_name'][$k];
		$target_file = date( "Ymd.His").'_'.$_FILES['userImage']['name'][$k];
		if(move_uploaded_file($source_file,$target_file)) {
			echo $source_file.'上傳成功';
		}
	}
}

Line 自訂分享訊息

<input id="msg_data" type="text" class="form-control " value=""  />
<button onclick="sendLine();">傳Line</button>
function sendLine(){
    var msg = $( "#chat_msg_data" ).val();
    var encoded = encodeURIComponent(msg);
    if(encoded){
        window.location.replace("https://line.me/R/share?text="+encoded );
    }else{
        alert('請輸入訊息');
    }
}

1.文字內容務必urlencode過
2.傳送網址格式可以用
https://line.me/R/share?text={text_message}

https://line.me/R/msg/text/?{text_message}

更多功能可以參考

https://developers.line.biz/en/docs/line-login/using-line-url-scheme/#available-line-url-schemes

地址連結開啟Google Map

連結 : https://www.google.com/maps/place/地址

地址建議先用 urlencode 處理過

https://www.google.com/maps/place/100%E5%8F%B0%E5%8C%97%E5%B8%82%E4%B8%AD%E6%AD%A3%E5%8D%80%E5%8C%97%E5%B9%B3%E8%A5%BF%E8%B7%AF3%E8%99%9F

另外一種用法:https://www.google.com/maps/search/?api=1&query=地址

這種用法可套用google map api 達成某些功能

https://developers.google.com/maps/documentation/urls/get-started#search-action

電話超連結

按下連結時會自動開啟撥號程式打電話

連結格式 tel:電話號碼

<a href="tel:<?=$mobile;?>"><?=$mobile;?></a>
<a href="tel:<?=$tel;?>"><?=$tel;?></a>

國際標準

+國碼-電話號碼,台灣號碼如果開頭為0要把0拿掉

$call_mobile_pos = strpos($mobile, '0');
if( $call_mobile_pos === 0) {
    $call_mobile = substr($mobile,1); 
} 
<a href="tel:+886-<?=$call_mobile;?>"><?=$mobile;?></a>

市話區碼開頭為0也要移除

if( strpos($tel, '0' ) === 0) {
     $call_tel = substr($tel,1);
}
<a href="tel:+886-<?=$call_tel;?>"><?=$tel;?></a>

Bootstrap 4.6 初始頁面

一切從此開始

<?
$title= 'Hello, world!';
?>
<!doctype html>
<html lang="zh-Hant-TW">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css" integrity="sha384-zCbKRCUGaJDkqS1kPbPd7TveP5iyJE0EjAuZQTgFLD2ylzuqKfdKlfG/eSrtxUkn" crossorigin="anonymous">
	<!-- jquery ui css -->
	<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" >

    <title><?=$title?></title>
  </head>
  <body>
    <h1>Hello, world!</h1>

    <!-- Optional JavaScript; choose one of the two! -->

    <!-- Option 1: jQuery and Bootstrap Bundle (includes Popper) -->
    <!-- no ajax <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script> -->
    <script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
	<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-fQybjgWLrvvRgtW6bFlB7jaZrFsaBXjsOMm/tB9LTS58ONXgqbR9W8oWht/amnpF" crossorigin="anonymous"></script>
	<!-- UI -->
	<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>
    <!-- Option 2: Separate Popper and Bootstrap JS -->
    <!--
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.min.js" integrity="sha384-VHvPCCyXqtD5DqJeNxl2dtTyhF78xXNXdkwX1CZeRusQfRKp+tA7hAShOK/B/fQ2" crossorigin="anonymous"></script>
    -->
  </body>
</html>