Categories
PHP

Type Conversion: Convert variable data type

PHP provides several mechanisms to allow variables of one type to be considered as another type. Variables can be explicitly converted to another type with the settype, strval, intval, boolval and floatval functions.

Categories
PHP

Determine Variable Data Type

PHP is known as a loosely-typed language. It converts a variable’s data type automatically, depending on the context in which the variable is used. For example, you can initialize a variable with an integer value, add a float value to it, thereby turning it into a float, then join it onto a string value to produce a string:

Categories
PHP

Data Types

Variables don’t need to be declared, and they have no type until they are assigned a value. PHP is loosely typed, meaning that it automatically determines the data type at the time data is assigned to each variable. It means a variable can hold an integer and then later in the script it can hold a string or some other data type.

Categories
PHP

Variable Substitution

Variable substitution is a way to embed data held in a variable directly into string literals. PHP parse double-quoted (and heredoc) strings and replace variable names with the variable’s value.

Categories
PHP

Delimiting Strings

PHP strings can be delimited in four different ways. A string is any series of characters enclosed in single (‘ ‘) or double (” “) quotes, or that you create using special heredoc or nowdoc syntax.

Categories
PHP

Variable Assignment, Expressions, and Operators

Variables are containers for storing information, such as numbers or text so that they can be used multiple times in the code. Variables in PHP are identified by a dollar sign ($) followed by the variable name. A variable name must begin with a letter or the underscore character and only contain alphanumeric characters and underscores. A variable name cannot contain spaces. Finally, variable names in PHP are case-sensitive.

Categories
PHP

PHP Development Environment

PHP is a server-side scripting language – a PHP script usually runs on a Web server and is processed by the PHP engine each time it’s run. A PHP script can be written using plain text and can be created with any text editor. For a Windows OS you can use notepad, and for a Unix-based OS you can use vi, nedit, emacs, or pico. PHP scripts are usually written using characters from the 7-bit ASCII character set.

Categories
PHP

Introducing PHP

PHP is a scripting language that’s usually combined with HTML and has many excellent libraries that provide fast, customized access to databases. The current latest version of PHP is PHP 8.1, which we call PHP throughout this tutorial. The current stable releases at the time of writing are 7.4.29, 8.0.18, and 8.15.

Categories
Excel

Workspace: Create a Personal View of Your Workbooks

Excel enables you to have multiple workbooks showing simultaneously, and to have a customized view of your workbooks arranged in different windows. Then you can save your view workspaces as .xlw files and use them when it suits you.

Categories
Excel

Tie Custom Toolbars to a Specific Workbook or Worksheet

Some workbooks require specific custom toolbars to enhance their functionality. You can learn how to link these toolbars to their corresponding workbooks with this tutorial. This way, you can avoid cluttering your interface with unnecessary toolbars that only apply to certain workbooks.