execute function php
function functionName() { //code to be executed; } functionName();
php preg_replace function
preg_replace($pattern, $replacement, $string);
Source: www.php.net
php function use
// Inherit $message $example = function () use ($message) { var_dump($message); }; $example();
Source: www.php.net
php function
$myarray = array_filter($myarray, 'strlen'); //removes null values but leaves "0" $myarray = array_filter($myarray); //removes all null values
PHP Functions
<?php function writeMsg() { echo "Hello world!"; } writeMsg(); // call the function ?>