You Are Browsing :
HOME > Archive by tag '
PHP'
Posts Tagged ‘PHP’
Thursday, March 5th, 2009
PHP’s === Operator enables you to compare or test variables for both equality and type. Refer below for example.
<?php
//define variables..
$str = '9';
$int = 9;
//Returns true since both variable contains the same value..
$res = ($str==$int);
//Returns false since the two variables are not of the same type..
$res = ($str===$int);
?>
Tags: PHP, PHP Tutorials
Posted in PHP, PHP Tutorials | 8 Comments »
Tuesday, March 3rd, 2009
To compare php variables to determine whether they are the same or different.. you can use PHP Comparison Operators. See below for a list of examples..
I. Define the Variables
<?php
$num1 = 9;
$num2 = 9;
$num3 = 22;
?>
A. The Less Than Operator
<?php
//Returns true if variable in the left side is less than the right..
$res = ($num1 < $num3);
//returns true..
?>
(more…)
Tags: PHP, PHP Tutorials
Posted in PHP, PHP Tutorials, Tips and Tutorials | 6 Comments »
Sunday, January 18th, 2009
You can concatenate or add strings together using the PHP string concatenation operator represented by the period sign ( . ). refer to the examples below.
<?php
// intialize variables
$username = "daniel";
$domain = "danieldumas.com";
// the variable string $username and $domain can be combine using the concatenation operator
$email_address = $username . '@'. $domain;
//the variable $email_address now contains the value "daniel@danieldumas.com"
?>
You can also concatenate simultaneously. . (more…)
Tags: PHP, PHP Tutorials
Posted in PHP, PHP Tutorials | 6 Comments »
Sunday, January 4th, 2009
Using Arithmetic Operators in PHP you can perform mathematical operations on PHP variables. refer to the example below.
Using PHP Arithmetic Operator
//define variables
<?php
$num1 = 50;
$num2 = 30;
//Addition
$sum = $num1 + $num2;
//Subtraction
$difference = $num1 - $num2;
//Multiplication
$product = $num1*$num2;
//Division
$quotient = $num1 / $num2;
//Modulus
$remainder = $num1 % $num2;
?>
you may also use the shorthand using the PHP Assignment Operator and Arithmetic Operator together. (more…)
Tags: PHP, PHP Tutorials
Posted in PHP, PHP Tutorials | No Comments »
Wednesday, December 31st, 2008
PHP Operators are very important, if PHP variables is the building blocks of PHP programming PHP Operators is the tool that lets you do something useful with variables. php comes with many useful operators such as Assignment Operator, Arithmetic Operator, String Operator, Comparison Operator and Logical Operator. (more…)
Tags: PHP, PHP Tutorials
Posted in PHP, PHP Tutorials | 6 Comments »
Friday, November 28th, 2008
Detecting the datatype of a specific PHP variable can be done by using PHP gettype() function. refer below for example.
<?php
//define variables
$on = true;
$age = 20;
$name = "daniel";
$price = 99.99;
//Returns Boolean
echo gettype($on);
//Returns String
echo gettype($name);
//Returns Integer
echo gettype($age);
//Returns Double
echo gettype($price);
?>
(more…)
Tags: PHP, PHP Tutorials
Posted in PHP, PHP Tutorials | 5 Comments »
Monday, November 10th, 2008
form can add interactivity to your site, it enables you to get information or comments from your visitors. saving a value from a form input to a php variable is very easy. refer to the example below.
Example 1: Processing forms in the same php file
Copy and Paste the code below to your text editor and save it as form.php, then run it on your localhost (more…)
Tags: PHP, PHP Tutorials
Posted in PHP, PHP Tutorials, Tips and Tutorials | 2 Comments »
Friday, October 24th, 2008
Fatal error: Allowed memory size of …… bytes exhausted (tried to allocate …. bytes) in home/of/some/thing/fishy.php
I experienced this weird Wordpress or rather PHP error last night when trying to view my blog when i got home, at first i thought that there was a technical problem at my server so i waited, then i waited and waited and waited again for almost 7 hours then i cant wait no more i want to blogggg… so i contact my hosting provider and they told me that there is nothing wrong with the server nahhh WTF! i told to my self. .
(more…)
Tags: blogging, PHP, PHP Tutorials, Tips and Tutorials, wordpress
Posted in PHP, PHP Tutorials, Tips and Tutorials, Wordpress Plugins, blogging, kwento lang, wordpress | 8 Comments »