Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/230.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP在动态文本中插入include-两个动态元素,它还会执行吗?_Php_Regex_Preg Replace - Fatal编程技术网

PHP在动态文本中插入include-两个动态元素,它还会执行吗?

PHP在动态文本中插入include-两个动态元素,它还会执行吗?,php,regex,preg-replace,Php,Regex,Preg Replace,我有一个有趣的问题,至少我认为是这样 我有这个网站。您将看到图像及其下方的内容 是否可以将图像与文本组合,并将图像左对齐,使文本在图像旁边流动 页面都是动态创建的,页面上的内容是我从mysql数据库导入的变量 以下是一些编码: <div id="yui-main"><div class="yui-b"><?php echo $g_page_content2 ?><br /> <?php include($_SERVER['DOCU

我有一个有趣的问题,至少我认为是这样

我有这个网站。您将看到图像及其下方的内容

是否可以将图像与文本组合,并将图像左对齐,使文本在图像旁边流动

页面都是动态创建的,页面上的内容是我从mysql数据库导入的变量

以下是一些编码:

<div id="yui-main"><div class="yui-b"><?php echo $g_page_content2 ?><br />
      <?php include($_SERVER['DOCUMENT_ROOT'].'/includes/standard_images_screenshot_1.php');?><?php echo $g_content_text1 ?>
      <?php /* This is the second banner for this page */ include($_SERVER['DOCUMENT_ROOT'].'/includes/banners/'.$row_rs_settings['g_sites_affiliate_ads2'].'.php');?></div>

$g_content_text1是拉入文本的变量,“/includes/standard_images_screenshot_1.php”是图像。include图像文件是动态创建图像的脚本(imagick)的一部分

然而,这或多或少是我的想法:

创建一个正则表达式,将第一次出现的
替换为这个
include($\u SERVER['DOCUMENT\u ROOT']./includes/banners/'.$row\u rs\u settings['g\u sites\u affiliate\u ads2'.].php'
,但我不确定如果我这样做,php是否仍然会执行

任何关于如何实现这一目标的想法都将不胜感激。

我不明白。 为什么要创建一个regexp,让文本在图像左侧流动? 这是一个css问题。
只需将float:left添加到图像中。

即使图像代码和文本之间有一个段落,它也能工作吗冒险宫是一个梦幻般的工具!!!它能工作-非常感谢-我已经多年没有这样做了!-我已经很长时间混淆了表格和段落元素…没想到这么容易,而且会创建一个非常复杂的com重复工作!