Selasa, 07 September 2010

Functions for manipulate String in PHP

Understanding how to manipulate strings in PHP will help you tremendously. It will allow
you to validate user input and extract data from text files in an efficient manner. PHP gives
you an enormous number of functions to manipulate strings—take a look at Table 4.3.
Most of the functions are fairly self explanatory, such as strlen(). But others need a little
bit more attention. printf() and sprintf() are good examples of these; let’s take a closer
look at these two functions.



Minggu, 05 September 2010

The If Statement in C language

Relational operators are used mainly to construct the relational expressions used in if and while statements, covered in detail on Day 6, "Basic Program Control." For now, I'll explain the basics of the if statement to show how relational operators are used to make program control statements.
You might be wondering what a program control statement is. Statements in a C program normally execute from top to bottom, in the same order as they appear in your source code file. A program control statement modifies the order of statement execution. Program control statements can cause other program statements to execute multiple times or to not execute at all, depending on the circumstances. The if statement is one of C's program control statements. Others, such as do and while, are covered on Day 6.

Operators in C language

An operator is a symbol that instructs C to perform some operation, or action, on one or more operands. An operand is something that an operator acts on. In C, all operands are expressions. C operators fall into several categories:
  • The assignment operator
  • Mathematical operators
  • Relational operators
  • Logical operators

Symbolic Constants

A symbolic constant is a constant that is represented by a name (symbol) in your program. Like a literal constant, a symbolic constant can't change. Whenever you need the constant's value in your program, you use its name as you would use a variable name. The actual value of the symbolic constant needs to be entered only once, when it is first defined.
Symbolic constants have two significant advantages over literal constants, as the following example shows. Suppose that you're writing a program that performs a variety of geometrical calculations.