相关疑难解决方法(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中将两个字符串组合在一起?

我实际上不知道如何描述我想要的东西,但我会告诉你:

例如:

$data1 = "the color is";
$data2 = "red";
Run Code Online (Sandbox Code Playgroud)

我应该做什么(或处理)所以$ result是$data1$data2?的组合?

期望的结果:

$result = "the color is red";
Run Code Online (Sandbox Code Playgroud)

php string variables combinations

127
推荐指数
9
解决办法
46万
查看次数

如何在PHP中连接字符串?

我想用一些字符串文字HTML回显PHP函数.

这就是我认为它的完成方式:

echo '<a href="' + $prevpost->url()  + '" class="postnav left nextpost"></a>';
Run Code Online (Sandbox Code Playgroud)

......但是没有回报.我尝试了引号等的小变化但是我担心我正在咆哮错误的树,我无法真正找到我需要的搜索.

注意:echo $prevpost->url();在任何人询问是否有效之前,确实会返回我尝试链接的URL.

php

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

php如何循环附加到变量

我有这段可以运行的 PHP 代码:

for ($i=0; $i < 5; $i++) {
    do stuff to $class
    echo "<i class=\"glyphicon glyphicon-star $class\"></i>";
}
Run Code Online (Sandbox Code Playgroud)

我如何将每次迭代附加到一个变量(例如),然后能够显示结果,而不是echo在循环中使用$stars

echo "$stars";
Run Code Online (Sandbox Code Playgroud)

php

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

标签 统计

php ×4

arguments ×1

combinations ×1

operators ×1

string ×1

symbols ×1

variables ×1