使用img class=";在php字符串中嵌入图像;对准中心

使用img class=";在php字符串中嵌入图像;对准中心,php,html,wordpress,Php,Html,Wordpress,我正在设置一个Wordpress前端提交表单来发布,除了插入内容外,一切都正常 下面是我当前的php的外观 $my_post = array(); $my_post['post_title'] = $newid; $my_post['post_content'] = $id $my_post['post_author'] = 1; $my_post['post_status'] = publish; $my_post['post_category'] = array($a); // Insert

我正在设置一个Wordpress前端提交表单来发布,除了插入内容外,一切都正常

下面是我当前的php的外观

$my_post = array();
$my_post['post_title'] = $newid;
$my_post['post_content'] = $id
$my_post['post_author'] = 1;
$my_post['post_status'] = publish;
$my_post['post_category'] = array($a);
// Insert the post into the database
$post_id = wp_insert_post($my_post);
wp_redirect( site_url()."?p=$post_id" ); exit();
['post_content']部分目前只发布图像链接,但我试图将其与下面的内容结合起来

<img class="aligncenter" alt="" src="http://domain.com/image/image.gif" />

图像链接是$id

我试着设置除“aligncenter”之外在一定程度上有效的下方

$imageurl=“img class=aligncenter src=”;
$imageurl1=“”;
$my_post['post_content']=$imageurl1.$imageurl.$id.$imageurl2;
非常感谢您的帮助

$imageurl=“img class='aligncenter'alt='src='”;
 $imageurl = "img class='aligncenter' alt='' src='";
 $imageurl1 = "<";
 $imageurl2 = "'>";

 $my_post['post_content'] = $imageurl1.$imageurl.$id.$imageurl2;
$imageurl1=”
 $imageurl = "img class='aligncenter' alt='' src='";
 $imageurl1 = "<";
 $imageurl2 = "'>";

 $my_post['post_content'] = $imageurl1.$imageurl.$id.$imageurl2;