output will show the following results VolumeindriveCisWindows10VolumeSerialNumberis540D-CE99Directoryof"/> output will show the following results VolumeindriveCisWindows10VolumeSerialNumberis540D-CE99Directoryof">

Home >Backend Development >PHP Tutorial >PHP execution operator

PHP execution operator

WBOY
WBOYforward
2023-09-18 10:17:07967browse

PHP execution operator

Introduction

defines an execution operator in PHP. Strings enclosed in backticks (``) are treated as DOS commands (shell commands in UNIX/Linux) and their output is returned. The operation of this operator is similar to the shell_exec() function in PHP.

The following code executes the DIR command and returns the result as a string.

Example

<?php
$list=`dir *.php`;
echo "$list";
?>

Output

The following results will be displayed

Volume in drive C is Windows 10
Volume Serial Number is 540D-CE99
Directory of C:\xampp\php
01/27/2016 05:32 PM 18,869 CompatInfo.php
07/08/2020 06:40 PM 64 test.php
07/11/2020 02:13 PM 48 testscript.php
03/30/2013 05:59 PM 1,447 webdriver-test-example.php
4 File(s) 20,428 bytes
0 Dir(s) 178,002,157,568 bytes free

This is another example of the backtick operator. It executes the type command

Example

<?php
$list=&#39;type testscript.php&#39;;
echo "$list";
?>

Output

will show the following results

type testscript.php

The above is the detailed content of PHP execution operator. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete

Related articles

See more