Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/287.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 在CodeMirror文本区域设置默认语言_Php_Javascript_Html_Textarea_Codemirror - Fatal编程技术网

Php 在CodeMirror文本区域设置默认语言

Php 在CodeMirror文本区域设置默认语言,php,javascript,html,textarea,codemirror,Php,Javascript,Html,Textarea,Codemirror,如何设置CodeMirror TextArea在不回显标记的情况下理解PHP 文本区 <textarea id="code" name="code"> <?php echo '<?php'; ?> </textarea> 我已经解决了,你必须将模式更改为模式:“text/x-php”我已经解决了,你必须将模式更改为模式:“text/x-php”请将其作为答案发布,然后 var editor = CodeMirror.fromTextAr

如何设置CodeMirror TextArea在不回显标记的情况下理解PHP

文本区

<textarea id="code" name="code">
  <?php
    echo '<?php';
  ?>
</textarea>

我已经解决了,你必须将模式更改为模式:“text/x-php”

我已经解决了,你必须将模式更改为
模式:“text/x-php”
请将其作为答案发布,然后
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
        lineNumbers: false,
        matchBrackets: true,
        mode: "application/x-httpd-php",
        indentUnit: 4,
        indentWithTabs: true,
        enterMode: "keep",
        tabMode: "shift"
    });