相关疑难解决方法(0)

Reference — What does this symbol mean in PHP?

What is this?

This is a collection of questions that come up every now and then about syntax in PHP. This is also a Community Wiki, so everyone is invited to participate in maintaining this list.

Why is this?

It used to be hard to find questions about operators and other syntax tokens.¹
The main idea is to have links to existing questions on Stack Overflow, so it's easier for us to reference them, not to copy over content from …

php arguments symbols operators

4314
推荐指数
21
解决办法
63万
查看次数

PHP如果速记和回声在一行 - 可能吗?

什么是最好的,首选的写作方式,如速记单线,如:

expression ? $foo : $bar
Run Code Online (Sandbox Code Playgroud)

情节扭曲:我需要echo $fooecho $bar.任何疯狂的伎俩?:)

php if-statement echo shorthand

20
推荐指数
3
解决办法
6万
查看次数

我需要一个尾随的分号吗?

例:

<?php $formElement->display()?>
Run Code Online (Sandbox Code Playgroud)

这样没事,或者我应该提供一个; ?好吧,我想PHP解释器非常聪明,可以看到该行已完成并且由于末尾的?>而完成了表达式.对?

php

12
推荐指数
2
解决办法
4351
查看次数

php中的<?=?>特殊标签

任何人都可以解释一下这些特殊标签在php中是什么?

<?= ?>
Run Code Online (Sandbox Code Playgroud)

我在谷歌上找不到它.

php tags short-open-tags

7
推荐指数
1
解决办法
1324
查看次数

这个符号在PHP <?=中意味着什么

这个符号在PHP中意味着<?=什么?

用法示例:

<h2>Manage Role: > (<?= $myACL->getRoleNameFromID($_GET['roleID']); ?>)</h2> 
Run Code Online (Sandbox Code Playgroud)

php symbols

6
推荐指数
3
解决办法
4792
查看次数

<?=是什么意思?

什么是这条线的含义

<input type=text name="name" value="<?= $name ?>
Run Code Online (Sandbox Code Playgroud)

如果我们要声明为PHP我们不应该写 <?php instead of <?=

谢谢

php

5
推荐指数
2
解决办法
1066
查看次数

PHP数组到JSON - 未捕获的SyntaxError:意外的输入结束

我有一个存储在变量中的php嵌套数组$myArray,下面是var在将其转储到浏览器之后的样子(它不是一个完整的输出).

<?php var_dump($myArray); ?>
Run Code Online (Sandbox Code Playgroud)

输出:

array (size=4)
  'id' => string '162' (length=3)
  'content' => string 'Test content' (length=12)
  'children' => 
    array (size=16)
      0 => 
        array (size=4)
          'id' => string '29208' (length=5)
          'content' => string 'Test content 1' (length=14)
          'children' => 
            array (size=3)
              ...
      1 => 
        array (size=4)
          'id' => string '29215' (length=5)
          'content' => string 'Test content 2' (length=14)
          'children' => 
            array (size=1)
              ...
      2 => 
        array (size=3)
          'id' => string '29220' (length=5)
          'content' => string 'Test Content …
Run Code Online (Sandbox Code Playgroud)

javascript php json

1
推荐指数
1
解决办法
7907
查看次数