PHP – If / Else statement The if/else condition is the most simple form of conditional processing and you will find it in any programming language. So if you already know some other programming language this will be an easy read. If not, just read this tutorial carefully because it will be useful when …
PHP – Strings A string in PHP is a simple character concatenation like “Hello world!”, “Lorem Ipsum…” etc. We already learned about how to set a string in PHP using double and single quotes, nowdoc and heredoc syntax. Strings are one of the most used types of data. The simplest way to assign string values is …
PHP – Data types PHP like most other programming languages supports various data types. It is very important to understand that variable cand act in a distinct way depending on the type of data they contain. Here are all data types that PHP is using: String – Simple text surrounded by commas Integer – …
PHP – Echo content PHP has basically two ways of sending content to the browser and those are echo and print. The difference is that print returns a value of 1 when execute while echo doesn’t return anything. Another difference is that em>print accepts only one argument while echo accepts a list of arguments (as many as you …
PHP – Constants A constant is a type of variable that cannot be changed. A constant cannot be undefined and once his value has been set, it can not change his value along the script. Constants are usually found in configuration files containing information such as database user and password, database name, site URL …
PHP – Variables PHP variables are just a name for a value and you can simply use it like this $var_name = value;. They usually store sting characters and numeric values for later use in the programming block. Here is a simple example: PHP Code: <?php $a = “Welcome”; $b = “Hello”; $first = “John”; …
Introduction to PHP – Syntax So let’s start creating our first PHP file. The extension for PHP files is .php. You can create a .txt file and just rename it to extension to index.php for example. The name index.php is typically rendered automatically by accessing you domain name. PHP Code: <?php echo “<h1>My first PHP page!</h1>”; ?> This will …
Introduction to PHP – Installation To start using PHP you need a web server running PHP and MySQL. Although MySQL is not a must for using PHP, mixing this two you can achieve great things. You can easily find a hosting provider that supports PHP and MySQL. Since PHP coming for free, your hosting provider …
Introduction to PHP – Learn PHP Introduction to PHP – learn from examples As of php.net definition says, PHP is a recursive name for PHP: Hypertext Preprocessor and it is an open-source scripting language project. PHP is widely used by new and advanced programmers as it has really advanced features under the hood. Here is our …
HTML – Hidden fields Hidden fields will not be shown by the browser. Those are necessary when when we have to deal with forms and databases in MySQL, but it does not limit to that. We will use the hidden fields to send additional information to the database, in addition to the information sent …