Blog
Archive for the PHP Category
<?php
session_start();
$errors = array();
// If statement checks if some text has been submitted as an email and isn’t null
if(isset($_POST[’email’]) && $_POST[’email’] …
Read more
<?php
// PHP function to echo out the average of an array
function compute_average($arr_to_avg)
{
$number_of_values = count($arr_to_avg);
…
Read more
To change the time zone – which is the second parameter in ini_set() below – use a value from Read more
/***** Code Inside PHP Include *****/
<?php
//Create a Class for Body Tag Using PHP File Name
function body_class()
{
$body_call_var = $_SERVER[‘REQUEST_URI’];
if($body_call_var == ‘/index.php’ …
Read more
<?php if (homepage()): ?>
<?php echo ‘Home Title’; ?>
<?php elseif (officetour()): ?>
<?php echo ‘Office Tour Title’; ?>
<?php else: ?>
<?php echo ‘Default …
Read more