Programming in Linux Using PHP

Vector logo of the PHP programming language wi...
Image via Wikipedia

What is PHP?

If you’ve surfed the Internet recently, you may have already seen PHP during your travels. Although you’ve probably seen it on the Internet, you may not know much about it. PHP, an acronym for PHP Hypertext Preprocessor, is scripting language used for developing web pages. PHP is a powerful open-source scripting language that is both easy to learn and free!

Simply put, PHP is a scripting language that programmers use to design web pages. It works well in Open Source software environments (especially with Linux). Programmers like to use it mainly because it’s fairly easy to use. It has a syntax that is very similar to the popular “C” programming language. PHP currently, PHP has two major versions: PHP 4 and PHP 5. In addition, PHP is currently being developed.

Setting Up Your Environment

Before you begin programming with PHP, you’ll need to set up a development environment on your computer. In the following steps, you’ll use PHP with an Apache Web server running on Linux. However, you can also use PHP with Apache on any operating system.

Learning Syntax

PHP code sits inside a page with the HTML, and consists of plain-text. For example, an HTML page that shows “Hi, my name is Jerry” would be inside an HTML page named filename.php and looks like this:

Bright Hub Article

That is some simple PHP code below:
echo ‘Hi, my name is Jerry;
?>

The code between the is executed as PHP.

You’ll notice some places where the “php” after the question mark is missing. This practice is known as PHP short tags. As a programmer, you should always use full tags (?php) In addition, all PHP statements should end in a semi-colon. However, a semi-colon isn’t required to terminate the last line of a PHP block. The PHP closing tag ?> contains a semi-colon.

The above steps show some basic PHP code. You don’t need to be an experienced programmer to learn PHP. The only prerequisite is a basic understanding of HTML and a willingness to learn.

Enhanced by Zemanta

Programming in C

A selection of programming language textbooks ...
Image via Wikipedia
C is a programming language has become very popular among computer programmers and developers. You use C to create a list of instructions for your computer. Because it’s efficient and provides maximum control, C is fast becoming the programming language of choice for many developers.
With C, you can read/write code from a variety of computer platforms, anything from microcontrollers to all types of operating systems. You’ll be amazed at how much you can create by learning C. Once you learn C, it’s much easier for you to learn C++. In fact it’s very difficult to program in C++ before learning C. However, you’ll be amazed how much you can create by learning C. Since C is a programming language, you can use it to lists of instructions for a computer to follow.
The following are some of the features and functions of C:
1. C is a compiled language, meaning that you need to run it through a compiler before your computer can execute it.
2. With C, the actual code is human-readable. In other words, you can actually read and understand the code you write as a programmer, but the code that comes out of the compiler can be read by the computer only.
3. Although C is one of many different of programming languages, it’s been around for decades and has wide acceptance among programmers and developers.
4. Despite the fact that C has a cryptic style, it’s still fairly easy language to learn. It is a bit more cryptic in its style than some other languages, but you get beyond that fairly quickly.
5.If you are writing programs in C on a UNIX machine, the C compiler is available for free. As an example, you can write Common Gateway Interface (CGI) scripts in C on a UNIX computer, and then compile them for free.

C is a programming language has become very popular among computer programmers and developers. You use C to create a list of instructions for your computer. Because it’s efficient and provides maximum control, C is fast becoming the programming language of choice for many developers.
With C, you can read/write code from a variety of computer platforms, anything from microcontrollers to all types of operating systems. You’ll be amazed at how much you can create by learning C. Once you learn C, it’s much easier for you to learn C++. In fact it’s very difficult to program in C++ before learning C. However, you’ll be amazed how much you can create by learning C. Since C is a programming language, you can use it to lists of instructions for a computer to follow.
The following are some of the features and functions of C:
1. C is a compiled language, meaning that you need to run it through a compiler before your computer can execute it.
2. With C, the actual code is human-readable. In other words, you can actually read and understand the code you write as a programmer, but the code that comes out of the compiler can be read by the computer only.
3. Although C is one of many different of programming languages, it’s been around for decades and has wide acceptance among programmers and developers.
4. Despite the fact that C has a cryptic style, it’s still fairly easy language to learn. It is a bit more cryptic in its style than some other languages, but you get beyond that fairly quickly.
5.If you are writing programs in C on a UNIX machine, the C compiler is available for free. As an example, you can write Common Gateway Interface (CGI) scripts in C on a UNIX computer, and then compile them for free.

Enhanced by Zemanta