js代碼
var socket = io("xxxxxx");
// uid可以是自己網(wǎng)站的用戶id,以便針對uid推送以及統(tǒng)計在線人數(shù)
var uid = "xxxxx";
// socket連接后以uid登錄
socket.on('connect', function(){
socket.emit('login', uid);
});
這段代碼怎么用php寫,
$post_data = array(
"type" => "publish",
"content" => "這個是推送的測試數(shù)據(jù)",
"to" => $to_uid,
); 這個type有登陸的嗎?