有没有理由我没有看到,为什么这不行?
$journalName = $_POST['journalName']; $journalName = str_replace(' ','_',$journalName); $_SESSION['journalName'] = $journalName; echo $_SESSION['journalName'];
我建议您使用它,因为它将检查单个和多个空白空间(由Lucas Green提出).
原文链接:https://www.f2er.com/php/140230.html$journalName = preg_replace('/\s+/',$journalName);
代替:
$journalName = str_replace(' ',$journalName);