• PHP - Concatenate Strings
    String Concatenation To concatenate, or combine, two strings you can use the . operator: ExampleGet your own PHP Server $x = "Hello"; $y = "World"; $z = $x . $y; echo $z; Try it Yourself » The result of the example above is HelloWorld, without a space between the two words. You can add a space character like this: Example $x = "Hello"; $y = "World"; $z =...
    0 Comments 0 Shares 3K Views 0 Reviews
  • PHP Constants
    Constants are like variables, except that once they are defined they cannot be changed or undefined. PHP Constants A constant is an identifier (name) for a simple value. The value cannot be changed during the script. A valid constant name starts with a letter or underscore (no $ sign before the constant name). Note: Unlike variables, constants are automatically global across the...
    0 Comments 0 Shares 2K Views 0 Reviews
  • PHP echo and print Statements
    With PHP, there are two basic ways to get output: echo and print. In this tutorial we use echo or print in almost every example. So, this chapter contains a little more info about those two output statements. PHP echo and print Statements echo and print are more or less the same. They are both used to output data to the screen. The...
    0 Comments 0 Shares 3K Views 0 Reviews
  • PHP Syntax
    A PHP script is executed on the server, and the plain HTML result is sent back to the browser. Basic PHP Syntax A PHP script can be placed anywhere in the document. A PHP script starts with <?php and ends with ?>: <?php // PHP code goes here ?> The default file extension for PHP files is ".php". A PHP file normally contains HTML tags, and some PHP...
    0 Comments 0 Shares 3K Views 0 Reviews
  • PHP Variables Scope
    PHP Variables Scope In PHP, variables can be declared anywhere in the script. The scope of a variable is the part of the script where the variable can be referenced/used. PHP has three different variable scopes: local global static Global and Local Scope A variable declared outside a function has a GLOBAL SCOPE and can only be accessed outside a function: ExampleGet...
    0 Comments 0 Shares 3K Views 0 Reviews