Archive for the ‘PHP’ Category

PHP Operators: The === Operator

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);
?>
Share and Bookmark this Post..

  • Digg
  • Yahoo! Buzz
  • Twitter
  • Facebook
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
  • Technorati
  • Reddit
  • Sphinn
  • MySpace
  • Slashdot
  • BlinkList
  • Live
  • Mixx
  • NewsVine
  • Yahoo! Bookmarks
  • Ratimarks
  • LinkedIn

PHP Operators : Using Comparison Operators

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…)

Share and Bookmark this Post..

  • Digg
  • Yahoo! Buzz
  • Twitter
  • Facebook
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
  • Technorati
  • Reddit
  • Sphinn
  • MySpace
  • Slashdot
  • BlinkList
  • Live
  • Mixx
  • NewsVine
  • Yahoo! Bookmarks
  • Ratimarks
  • LinkedIn

PHP Operators: Using String Concatenation Operator

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…)

Share and Bookmark this Post..

  • Digg
  • Yahoo! Buzz
  • Twitter
  • Facebook
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
  • Technorati
  • Reddit
  • Sphinn
  • MySpace
  • Slashdot
  • BlinkList
  • Live
  • Mixx
  • NewsVine
  • Yahoo! Bookmarks
  • Ratimarks
  • LinkedIn

PHP Operators : Using Arithmetic Operators

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…)

Share and Bookmark this Post..

  • Digg
  • Yahoo! Buzz
  • Twitter
  • Facebook
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
  • Technorati
  • Reddit
  • Sphinn
  • MySpace
  • Slashdot
  • BlinkList
  • Live
  • Mixx
  • NewsVine
  • Yahoo! Bookmarks
  • Ratimarks
  • LinkedIn

PHP Operators

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…)

Share and Bookmark this Post..

  • Digg
  • Yahoo! Buzz
  • Twitter
  • Facebook
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
  • Technorati
  • Reddit
  • Sphinn
  • MySpace
  • Slashdot
  • BlinkList
  • Live
  • Mixx
  • NewsVine
  • Yahoo! Bookmarks
  • Ratimarks
  • LinkedIn

Detecting the data type of a PHP variable

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…)

Share and Bookmark this Post..

  • Digg
  • Yahoo! Buzz
  • Twitter
  • Facebook
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
  • Technorati
  • Reddit
  • Sphinn
  • MySpace
  • Slashdot
  • BlinkList
  • Live
  • Mixx
  • NewsVine
  • Yahoo! Bookmarks
  • Ratimarks
  • LinkedIn

PHP and MySQL Basics: Saving form input in PHP variables

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…)

Share and Bookmark this Post..

  • Digg
  • Yahoo! Buzz
  • Twitter
  • Facebook
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
  • Technorati
  • Reddit
  • Sphinn
  • MySpace
  • Slashdot
  • BlinkList
  • Live
  • Mixx
  • NewsVine
  • Yahoo! Bookmarks
  • Ratimarks
  • LinkedIn

Fix wordpress fatal error allowed memory size exhausted

Friday, October 24th, 2008

Fatal error: Allowed memory size of …… bytes exhausted (tried to allocate …. bytes) in home/of/some/thing/fishy.php :)

Wordpress Fatal Error allowed memory size exhaustedI 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…)

Share and Bookmark this Post..

  • Digg
  • Yahoo! Buzz
  • Twitter
  • Facebook
  • StumbleUpon
  • del.icio.us
  • Google Bookmarks
  • Technorati
  • Reddit
  • Sphinn
  • MySpace
  • Slashdot
  • BlinkList
  • Live
  • Mixx
  • NewsVine
  • Yahoo! Bookmarks
  • Ratimarks
  • LinkedIn



Subscribe to feed

this blog use Comment Luv

Featured Post


Make your Wordpress URL Search Engine Friendly
Simple steps to make your wordpress url search engine friendly..


Give some luv with comment luv
This blog is now comment luv powered..


Fix Wordpress PHP fatal error memory size exhauster
Ways on how to solve PHP fatal error or PHP memory limit on wordpress blogs anr other opensource web apps..


Download Norton Antivirus Internet Security for free
Read this post to know how you can download a free norton antivirus or internet security..


Sponsored Links


 6 Users Online