我想创建我的应用程序的后端,它必须允许表情符号发送。使用表格和php POST
它会发送到一个文件,该文件使用表情符号(和可选文本)发送通知。 但是如果我使用$_POST
它不会被编码,并且只发为笑脸,这将不是由设备(苹果转换吗?)接受php post to use JSON_ENCODE
我的代码:
$message = $_POST['message']; // contains only ->
$test = "";
echo json_encode($test); //output = "\ud83d\ude07" AS it should be
echo json_encode(strval($message)); //outputs which is false.
如果我使用$_GET['message']
并更改我的其他脚本它将工作(使用测试文件来检查)。 然而,考虑到安全性(浏览器历史等),我想使用$_POST
。
我该如何做到这一点?
- 按要求填写表格。 请不要说这就是我需要的全部到目前为止。 ]
<html>
<head>
</head<
<body>
<form action="./simplepush.php" method="post">
Message : <input type="text" name="message" /><br />
<input type="submit" name="submit" value="Send" />
</form>
</body>
</html>
不使用任何头(或指定)
我也希望POST的价值(在Chrome和safari/OSX上测试)。你可以显示年表格和HTML标头吗? – fusion3k