Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/297.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 var_dump中的分析错误_Php - Fatal编程技术网

Php var_dump中的分析错误

Php var_dump中的分析错误,php,Php,以下代码中出现解析错误: <?php // This: $a = array( 'color' => 'red', 'taste' => 'sweet', 'shape' => 'round', 'name' => 'apple', 4 // key will be 0 ); $b = array('a', 'b', 'c'); /

以下代码中出现解析错误:

<?php
// This:
$a = array( 'color' => 'red',
            'taste' => 'sweet',
            'shape' => 'round',
            'name'  => 'apple',
            4        // key will be 0
          );

$b = array('a', 'b', 'c');

// . . .is completely equivalent with this:
$a = array();
$a['color'] = 'red';
$a['taste'] = 'sweet';
$a['shape'] = 'round';
$a['name']  = 'apple';
$a[]        = 4;        // key will be 0

$b = array();
$b[] = 'a';
$b[] = 'b';
$b[] = 'c';

// After the above code is executed, $a will be the array
// array('color' => 'red', 'taste' => 'sweet', 'shape' => 'round', 
// 'name' => 'apple', 0 => 4), and $b will be the array 
// array(0 => 'a', 1 => 'b', 2 => 'c'), or simply array('a', 'b', 'c')

var_dump($a);
echo <br>
var_dump($b);
echo <br>
?> 

PHP解析错误:语法错误,意外“您不能直接在PHP标记内输出HTML。请改用echo:


不能直接在PHP标记内输出HTML。请改用echo:


除非您不使用,否则无法自由混合HTML和PHP,您必须关闭PHP或使用echo

var_dump($a);?>
<br>
<?php var_dump($b);?>
<br>

除非您不使用,否则无法自由混合HTML和PHP,您必须关闭PHP或使用echo

var_dump($a);?>
<br>
<?php var_dump($b);?>
<br>

在尝试编码之前,请先学习一些基本的PHP。在尝试编码之前,请先学习一些基本的PHP。好的,但仍然不是parsing@AshishYadav:不是。试试看。好的,现在可以了,非常感谢。等5分钟,我会按照论坛的要求接受这个答案。好的,但仍然不行parsing@AshishYadav:不是。试试看。好的,现在可以了,非常感谢。等5分钟,我会按照论坛的要求接受这个答案。好的,但仍然没有解析第31行是echo语句。好的,但是仍然没有解析第31行是echo语句
var_dump($a);?>
<br>
<?php var_dump($b);?>
<br>