PHP
PHP
PHP
<?php
// PHP code goes here
?>
// This is a single-line comment
/*
This is a multiple-lines comment block
that spans over multiple
lines
*/
Variables Scope
local
global
static
<?php
$x = 5; // global scope
function myTest() {
$x = 5; // local scope
global $x;
$GLOBALS['y'] = $GLOBALS['x'] + $GLOBALS['y']; //array called $GLOBALS[index]
static $x = 0;//Note: The variable is still local to the function.
myTest();
https://www.w3schools.com/php/php_ref_string.asp
Parameters:
Constant Arrays
<?php
define("cars", [
"Alfa Romeo",
"BMW",
"Toyota"
]);
echo cars[0];
?>
<?php
define("GREETING", "Welcome to W3Schools.com!");
function myTest() {
echo GREETING;
}
myTest();
?>
You can easily do this by adding the following code in your wp-config.php file.
1
2
// Disallow file edit
define( 'DISALLOW_FILE_EDIT', true );
You can do this by opening a text editor like Notepad and paste this code:
1
2
3
<Files *.php>
deny from all
</Files>
Next, you need to save this file as .htaccess and upload it to /wp-content/uploads/
folders on your website using an FTP client.
https://www.wpbeginner.com/wordpress-security/