Home  >  Article  >  Backend Development  >  php取出post传递的特殊符号有关问题

php取出post传递的特殊符号有关问题

WBOY
WBOYOriginal
2016-06-13 11:50:221115browse

php取出post传递的特殊符号问题
前台页面有复选框(多选)框代码如下:

<select id="level" class="easyui-combobox" name="level" data-options=" multiple:true" style="width:150px;"><br />        <option value="'A+','A-','A','B','C','D'">All Level</option><br />        <option value="'A+','A-','A'">A</option><br />        <option value="'B'">B</option><br />        <option value="'C'">C</option><br />        <option value="'D'">D</option><br />    </select>


后台页面用post取出
	$level =isset($_POST['level'])? implode("",$_POST['level']):"'A+','A-','A','B','C','D'";

想用sql的in语句去数据库查询数据,但问题来了,这样传递的值sql老是报错,打印出来发现后台接收的值好像是个array,

请教下该怎么从正确的取到前面传来的多选值?
------解决方案--------------------
print_r($_POST['level']);
看看结果
------解决方案--------------------

------解决方案--------------------
echo date('Y-m-d H:i:s',strtotime("$datea -1 year"));

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn