Here is the second series of videos on the basics of PHP. Whether you’re a novice, or just brushing up, these videos will give you a more fundamental knowledge of the nature of programming in PHP. Today’s videos include variables, strings, and string functions.
This video covers the basics behind variables in PHP. Concepts include:
This video is dedicated to string data types. Concepts in this video include:
While this video focuses on PHP String functions, it focuses even more on learning more about PHP. Included are resources on where to learn more about PHP.
To view other PHP tutorial videos
PHP is not only a high demand server side scripting language, but it can also be a little intimidating for those getting into the language. The set of videos below will show you how to set up a development environment and write a Hello World script.
UPDATE: These videos should be watched after you learn how to setup a PHP server on your system. You can learn how to do this by going to this video.
This video provides information on the following:
This video tutorial describes some of the basic elements in a PHP file. It also put emphasis on saving files as PHP files rather than HTML files.
This video demonstrates the absolute basics of writing PHP, including the echo function, single line comments, multiline comments, and concatenation.
To view other PHP tutorial videos
In the Java programming language, variables must be declared before they are initialization. This is typically referred to as being statically typed. An example of such is as shown
byte carTotal = 3;
In this example a byte data type called carTotal holds a value of three. Based on the name of the variable, the variable could represent anything that stores a value or inventory of cars, such as a garage or small parking ramp. A primitive in Java is reserved by its own keyword and do not share states with other primitives.
| Type | Size in Bits | Values | Binary Values | Standard |
|---|---|---|---|---|
| boolean | 8 | true or false | N/A | N/A |
| char | 16 | ‘\u0000′ or ‘\uFFFF’
(0 to 65535)
|
N/A | ISO Unicode character set |
| byte | 8 | -128 to +127 | -27 to 27 – 1 | |
| short | 16 | -32,768 to +32,767 | -215 to 215-1 | |
| int | 32 | -2,147,483,648 to +2,147,483,647 | -231 to 231-1 | |
| long | 64 | -9,223,372,036,854,775,808 to +9,223,372,036,854,775,807 | -263 to 263-1 | |
| float | 32 | Negative range:
3.4028234663852886E+38 to 1.40129846432481707e45 Positive range: 1.40129846432481707e45 to 3.4028234663852886E+38 |
N/A | IEEE 754 floating point |
| double | 64 | Negative range:
1.7976931348623157E+308 to 4.94065645841246544e324 Positive range: 4.94065645841246544e324 to 1.7976931348623157E+308 |
N/A | IEEE 754 floating point |
The Java programming language also has support for character strings using the String class. If the character string is enclosed in double quotations, a new String object is automatically created. Here’s an example…
String str = “This is a string”;
Technically, a String value is not a primitive data type, but the thought can be established based on the special qualities that Java has for String objects. Finally, Strings are immutable, which means that once a value is assigned, the value cannot be changed.