Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/251.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
Javascript 如何使用php正确回显html行_Javascript_Php_Html - Fatal编程技术网

Javascript 如何使用php正确回显html行

Javascript 如何使用php正确回显html行,javascript,php,html,Javascript,Php,Html,我想使用php打印此文件: <input onfocusout="function("stringarg")" /> “未正确打印。首先,您不能使用此HTML: <input onfocusout="function("stringarg")" /> 如果要在回显中打印字符串变量,请使用此选项。尝试此代码,这将为您提供一个清晰的示例 <?php echo 'You do not have to echo everything in php in orde

我想使用php打印此文件:

<input onfocusout="function("stringarg")" />

“未正确打印。

首先,您不能使用此HTML:

<input onfocusout="function("stringarg")" />

如果要在回显中打印字符串变量,请使用此选项。

尝试此代码,这将为您提供一个清晰的示例

<?php
    echo 'You do not have to echo everything in php in order to display';
    echo 'You can actually breack php code by closing it.';
    echo 'This form below shows the exact example';

    echo '
        <form>
            <input type="text" placeholder="This input is inside php echo" >'; ?>
            <input type="text" placeholder="This input is outside php echo but still works the same"> <?php echo '

        </form>
        ';
?>
希望这能有所帮助。

幸运的是,它没有正确打印。你能展示一下你的代码和字符串是如何打印的吗?PHP:echo或HTML:1。显示用于打印格式错误的HTML的确切行/代码,2。向我们展示实际的格式错误的html,不清楚它是否已经包含在内。3.向我们展示您期望的行为以及可能的原因,以便我们可以添加更智能的解决方案
<input onfocusout='function("stringarg")' />
echo '<input onfocusout="function(\'stringarg\')" />';
<input onfocusout="function('stringarg')" />
echo '<input onfocusout="function(\''. $stringarg .'\')" />';
<?php
    echo 'You do not have to echo everything in php in order to display';
    echo 'You can actually breack php code by closing it.';
    echo 'This form below shows the exact example';

    echo '
        <form>
            <input type="text" placeholder="This input is inside php echo" >'; ?>
            <input type="text" placeholder="This input is outside php echo but still works the same"> <?php echo '

        </form>
        ';
?>