php define code example
Example 1: strpos in php
<?php
$mystring = 'abc';
$findme = 'a';
$pos = strpos($mystring, $findme);
if ($pos === false) {
echo "The string '$findme' was not found in the string '$mystring'";
} else {
echo "The string '$findme' was found in the string '$mystring'";
echo " and exists at position $pos";
}
?>
Example 2: define value in php
$var = 5;
$var = "hey";
$var = 'A';
Example 3: how to define function in php
<?php
function writeMsg() {
echo "Hello world!";
}
writeMsg();
?>
Example 4: define in php
define(name,value);
define(name,value,case_insensitive);
Example 5: define php
define("name", {value});