我有一个参数数组,我想通过它传递给函数call_user_func.以下代码目前将给出错误:Missing argument 2 for Closure.如何重写才能正常工作?
$args = array('foo', 'bar');
call_user_func(function($arg1, $arg2) {}, $args);
Run Code Online (Sandbox Code Playgroud) 我有一个编辑页面,用数据库中的原始内容填充内容,我使用内联php,它用标题填充字段,所有其他字段也可以.当我尝试使用相同的方法填充textarea时,它不起作用.除了作为文本的textarea之外,所有其他字段都是varchar.php是表单的值.
require_once('includes/db.inc.php');
$stmt = $mysqli->prepare("SELECT
postID,title,content,author,image
FROM posts where postID = ?");
$stmt->bind_param("i",$_GET['postID']);
$stmt->execute();
$stmt->bind_result($postID,$title,$content,$author,$image);
$stmt->fetch();
$stmt->close();
?>
<section id="createPost">
<form method="post" action="editPost.php">
<fieldset>
<legend>Edit Post: <?php echo $title ?></legend>
<input name="postID" type="hidden" value="<?php echo $postID; ?>">
<label for="titleOfPost">Title of Post:</label><br />
<input type="text" name="titleOfPost" size="82" placeholder="Enter title of post" required value="<?php echo $title ?>"><br />
<label for="bodyOfPost">Content of Post:</label><br />
<textarea cols="60" name="postContent" rows="10" placeholder="HTML tags allowed" value="<?php echo $content ?>"></textarea><br />
<label for="authorOfPost">Author:</label><br />
<input type="text" name="authorOfPost" size="82" …Run Code Online (Sandbox Code Playgroud)