Hướng dẫn execution operator in php - toán tử thực thi trong php

PHP hỗ trợ một toán tử thực thi: Backticks (``).Lưu ý rằng đây không phải là các tài liệu đơn lẻ!PHP sẽ cố gắng thực thi nội dung của các backticks dưới dạng lệnh shell;Đầu ra sẽ được trả về (nghĩa là, nó sẽ không được bỏ vào đầu ra; nó có thể được gán cho một biến).Việc sử dụng toán tử backtick giống hệt với shell_exec ().shell_exec().

$output = `ls -al`;
echo 
"

$output
";
?>

Ghi chú::

Toán tử backtick bị vô hiệu hóa khi shell_exec () bị tắt.shell_exec() is disabled.

Ghi chú::

Toán tử backtick bị vô hiệu hóa khi shell_exec () bị tắt.

Không giống như một số ngôn ngữ khác, Backticks không có ý nghĩa đặc biệt trong các chuỗi được trích xuất kép.

Robert ¶

Just a general usage note.  I had a very difficult time solving a problem with my script, when I accidentally put one of these backticks at the beginning of a line, like so:

[lots of code]
`    $URL = "blah...";
[more code]

Since the backtick is right above the tab key, I probably just fat-fingered it while indenting the code.

What made this so hard to find, was that PHP reported a parse error about 50 or so lines *below* the line containing the backtick.  (There were no other backticks anywhere in my code.)  And the error message was rather cryptic:

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /blah.php on line 446

Just something to file away in case you're pulling your hair out trying to find an error that "isn't there."

16 năm trước

OHCC tại 163 dot com ¶

You can use variables within a pair of backticks (``).

    $host = 'www.wuxiancheng.cn';
    echo `
ping -n 3 {$host}`;
?>

5 năm trước

paolo.bertani ¶

Just a general usage note.  I had a very difficult time solving a problem with my script, when I accidentally put one of these backticks at the beginning of a line, like so:1

Just a general usage note.  I had a very difficult time solving a problem with my script, when I accidentally put one of these backticks at the beginning of a line, like so:2

Just a general usage note.  I had a very difficult time solving a problem with my script, when I accidentally put one of these backticks at the beginning of a line, like so:3

Just a general usage note.  I had a very difficult time solving a problem with my script, when I accidentally put one of these backticks at the beginning of a line, like so:4

15 ngày trước

Ẩn danh ¶

Just a general usage note.  I had a very difficult time solving a problem with my script, when I accidentally put one of these backticks at the beginning of a line, like so:6

Just a general usage note.  I had a very difficult time solving a problem with my script, when I accidentally put one of these backticks at the beginning of a line, like so:7

Just a general usage note.  I had a very difficult time solving a problem with my script, when I accidentally put one of these backticks at the beginning of a line, like so:8

Just a general usage note.  I had a very difficult time solving a problem with my script, when I accidentally put one of these backticks at the beginning of a line, like so:9

[lots of code]
`    $URL = "blah...";
[more code]
0

[lots of code]
`    $URL = "blah...";
[more code]
1

[lots of code]
`    $URL = "blah...";
[more code]
2

[lots of code]
`    $URL = "blah...";
[more code]
3

[lots of code]
`    $URL = "blah...";
[more code]
4

[lots of code]
`    $URL = "blah...";
[more code]
5

18 năm trước

Anisgazig tại Gmail Dot Com ¶

[lots of code]
`    $URL = "blah...";
[more code]
7

[lots of code]
`    $URL = "blah...";
[more code]
8

[lots of code]
`    $URL = "blah...";
[more code]
9

Since the backtick is right above the tab key, I probably just fat-fingered it while indenting the code.0

Since the backtick is right above the tab key, I probably just fat-fingered it while indenting the code.1

Since the backtick is right above the tab key, I probably just fat-fingered it while indenting the code.2

Since the backtick is right above the tab key, I probably just fat-fingered it while indenting the code.3

Since the backtick is right above the tab key, I probably just fat-fingered it while indenting the code.4

Since the backtick is right above the tab key, I probably just fat-fingered it while indenting the code.5

Since the backtick is right above the tab key, I probably just fat-fingered it while indenting the code.6

Since the backtick is right above the tab key, I probably just fat-fingered it while indenting the code.7

Since the backtick is right above the tab key, I probably just fat-fingered it while indenting the code.8

Since the backtick is right above the tab key, I probably just fat-fingered it while indenting the code.9

What made this so hard to find, was that PHP reported a parse error about 50 or so lines *below* the line containing the backtick.  (There were no other backticks anywhere in my code.)  And the error message was rather cryptic:0

What made this so hard to find, was that PHP reported a parse error about 50 or so lines *below* the line containing the backtick.  (There were no other backticks anywhere in my code.)  And the error message was rather cryptic:1

What made this so hard to find, was that PHP reported a parse error about 50 or so lines *below* the line containing the backtick.  (There were no other backticks anywhere in my code.)  And the error message was rather cryptic:2

What made this so hard to find, was that PHP reported a parse error about 50 or so lines *below* the line containing the backtick.  (There were no other backticks anywhere in my code.)  And the error message was rather cryptic:3

What made this so hard to find, was that PHP reported a parse error about 50 or so lines *below* the line containing the backtick.  (There were no other backticks anywhere in my code.)  And the error message was rather cryptic:4

What made this so hard to find, was that PHP reported a parse error about 50 or so lines *below* the line containing the backtick.  (There were no other backticks anywhere in my code.)  And the error message was rather cryptic:5

What made this so hard to find, was that PHP reported a parse error about 50 or so lines *below* the line containing the backtick.  (There were no other backticks anywhere in my code.)  And the error message was rather cryptic:6

2 năm trước

yasuo_ohgaki tại hotmail dot com

What made this so hard to find, was that PHP reported a parse error about 50 or so lines *below* the line containing the backtick.  (There were no other backticks anywhere in my code.)  And the error message was rather cryptic:8

What made this so hard to find, was that PHP reported a parse error about 50 or so lines *below* the line containing the backtick.  (There were no other backticks anywhere in my code.)  And the error message was rather cryptic:9

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /blah.php on line 4460

21 năm trước

Phpnet DOT 20 DOT DPNSUBS tại Xoxy Dot Net ¶

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /blah.php on line 4462

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /blah.php on line 4463

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /blah.php on line 4464

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /blah.php on line 4465

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /blah.php on line 4466

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /blah.php on line 4467

15 năm trước

ivijan dot stefan tại gmail dot com ¶

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /blah.php on line 4468

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /blah.php on line 4469

Just something to file away in case you're pulling your hair out trying to find an error that "isn't there."0

Just something to file away in case you're pulling your hair out trying to find an error that "isn't there."1

Just something to file away in case you're pulling your hair out trying to find an error that "isn't there."2

Just something to file away in case you're pulling your hair out trying to find an error that "isn't there."3

Just something to file away in case you're pulling your hair out trying to find an error that "isn't there."4

18 năm trước

Anisgazig tại Gmail Dot Com ¶

Just something to file away in case you're pulling your hair out trying to find an error that "isn't there."6

2 năm trước

Phpnet DOT 20 DOT DPNSUBS tại Xoxy Dot Net ¶

Just something to file away in case you're pulling your hair out trying to find an error that "isn't there."7

15 năm trước

ivijan dot stefan tại gmail dot com ¶

Just something to file away in case you're pulling your hair out trying to find an error that "isn't there."8

Just something to file away in case you're pulling your hair out trying to find an error that "isn't there."9

0

1