Code

PHP 寫 LINE BOT 起手,複製貼上換一換就好

<?php

$access_token ='從 LINE 那邊取得的';

//define('TOKEN', '你的Channel Access Token');


//richmenu token

$richm = "這也是從 LINE 那邊取得的";


$json_string = file_get_contents('php://input');


//$file = fopen("LineLog.txt", "a+");

//fwrite($file, $json_string."\n");

$json_obj = json_decode($json_string);


$event = $json_obj->{"events"}[0];

$type = $event->{"message"}->{"type"};

$userid = $event->{"source"}->{"userId"};

$message = $event->{"message"};

$reply_token = $event->{"replyToken"};

$msgtext = $message->{"text"};

$postbackdata = $event->{"postback"}->{"data"};

$timestamp = $event->{"timestamp"};

$originalContentUrl = $message->{"contentProvider"}->{"originalContentUrl"}; //抓掃描回來的圖片後面所帶的資訊


$ss = $json_string;


session_start();

//$_SESSION['line_userid'] = $userid;

?>

IIS + PHP + ffmpeg-php + FFmpeg

假設已經安裝完 Windose server IIS + PHP 7

以下套件 :