You are here: Daniel Dumas »

Category : PHP Tutorials

PHP Auto-Increment and Auto-Decrement Operators

The auto-increment operator designed to automatically increment the value of the variable it is attached to by 1. It is represented by a double addition symbol (++). To see it in action, run the following script:


<?php
// define $total as 10
$total = 10;
// increment it
$total++;
// $total is now 11

?>

Thus, <?php $total++; ?> is functionally equivalent to <?php
$total = $total + 1; ?>.
There’s also a corresponding auto-decrement operator (––), which does exactly the opposite:


<?php
// define $total as 10
$total = 10;
// decrement it
$total--;
// $total is now 9

?>

These operators are frequently used in loops to update the value of the loop counter.

PHP Logical Operators

Hey guys! welcome me back! yes, i am finally back again. i been away for a long time, but i am now back again in the blogosphere to share some PHP tutorials, tips and other web development ideas, tips and tricks etc.

for today i will discuss about PHP Logical Operators.

To link together related conditions in a simple and elegant manner, we can use Keep Reading…

CSS Stylesheet Switcher using PHP

Hi everyone! today I’ll teach you how to separate CSS stylesheet for your website or web projects. there are many ways to do this but I am going to use PHP for this tutorial.

As a Web Developer or Web Designer, it is important that website’s we develop are working on all major browsers, or on all(old or new) browsers if possible. but some browsers (specially the old one’s) has their own specific way Keep Reading…

PHP and MySQL Basics: Comments

For greater readability of your PHP code, you should add comments to it, so that you or other people who will look at the code later will understand it clearly.

To do this refer to the example below..

PHP Single Line Comment: Keep Reading…

PHP and MySQL Basics: Your First PHP Script

Now that you know the basic syntax of PHP, let me congratulate you, congrats! hehe. . You are now ready to learn your very first PHP script.

consider this example on embedding your first PHP script into HTML.

<html>
<head>
<title>Hello World!</title>
</head>
<body>
<!-- This is how you print output in PHP-->

<h2><?php echo "Philippines is a beautiful country!"; ?></h2>

</body>
</html>

copy and save this to your text editor with a .php extension then run it on your localhost.. Keep Reading…

PHP and MySQL Basics Tutorial

PHP Basics

Hello guys today i am going to start my basic PHP tutorial. i will give examples in every part of this tutorial so that you can follow with me easily. my aim in this tutorial is to share my knowledge in PHP to anyone specially to my blog readers who wants to learn the basics of PHP. i will focus on the very basic of PHP so that anyone can follow along even if you dont have any background in PHP or any other programming language Keep Reading…