Prepare your apps to PHP7, which is soon to become the “current” version. One of the problems might be the usage of preg_replace() function with “/e” modifiers. You might get this error message: Deprecated function: preg_replace(): The /e modifier is
PHP remove multiple whitespaces
Replacing multiple spaces with a single space simple single line of php code: $output = preg_replace(‘/\s+/’, ‘ ‘, $input); This mean that spaces, tabs or line breaks (one or more) will be replaced by a single space. Replace multiple spaces
Yii2: create helper
How to create a new helper in Yii2 framework: Create a new file “Utils.php” in “app-basic\helpers” or in other folder, location is up to you, but keep things organized! <?php namespace yii\helpers; use Yii; class Utils { public static function
PHP short tags: if/else
Alternative syntax for control structures. PHP offers an alternative syntax for some of its control structures; namely, if, while, for, foreach, and switch. In each case, the basic form of the alternate syntax is to change the opening brace to
CodeIgniter: get IP address and user agent
If you need to collect visitor’s IP address or browser information you can easily do that using CodeIgniter “user_agent” library. The User Agent Class provides functions that help identify information about the browser, mobile device, or robot visiting your site. In addition you
MVC: model – view – controller
Model–View–Controller (MVC) is an architecture that separates the representation of information from the user’s interaction with it. The model consists of application data and business rules, and the controller mediates input, converting it to commands for the model or view.
Getting Started With CodeIgniter
If you are familiar with php, a good practice is to use a php framework to build your applications. One choice is CodeIgniter. CodeIgniter is based on the Model-View-Controller development pattern. MVC is a software approach that separates application logic
Hello world!
First article! Definitely must be a “Hello World” examples article. A “Hello World” program is a computer program which prints out “Hello, world!” on a display device. It is used in many introductory tutorials for teaching a programming language. It