Blog

python tutorials and learn python

Created with Sketch.

PHP $this

PHP $this Summary: in this tutorial, you will learn about PHP $this keyword and how to use $this inside a class to reference the current object. What is $this in PHP? In PHP, $this keyword references the current object of the class. The $this keyword allows you to access the properties and methods of the…
Read more

PHP Objects

PHP Objects Summary: in this tutorial, you will learn about PHP objects, how to define a class, and how to create an object from a class. What is an Object If you look at the world around you, you’ll find many examples of tangible objects: lamps, phones, computers, and cars. Also, you can find intangible…
Read more

PHP OOP

PHP OOP This PHP OOP series helps you master Object-oriented Programming in PHP. PHP introduced object-oriented programming features since version 5.0. Object-Oriented programming is one of the most popular programming paradigms based on the concept of objects and classes. PHP OOP allows you to structure a complex application into a simpler and more maintainable structure.…
Read more

PHP date

PHP date Summary: in this tutorial, you’ll learn how to use the PHP date() function to format a timestamp using a specified format. Introduction to the PHP date() function The date() function formats a timestamp using a specified format: date(string $format, int|null $timestamp = null): string Code language: PHP (php) The date() function has two…
Read more

PHP time

PHP time Summary: in this tutorial, you’ll learn how to work with the PHP time() function to get the current timestamp in the local timezone. Introduction to Unix timestamps Computers store a date and time as a UNIX timestamp or a timestamp in short. A timestamp is an integer that refers to the number of…
Read more

PHP preg_replace

PHP preg_replace Summary: in this tutorial, you’ll learn how to use the PHP preg_replace() function to search and replace using regular expressions. Introduction to the PHP preg_replace() function The preg_replace() function searches for matches and replaces them with a pattern. The following shows how to use the preg_replace() function with a single string: preg_replace( string…
Read more

PHP preg_match_all

PHP preg_match_all Summary: in this tutorial, you’ll learn how to use the PHP preg_match_all() function to search for all matches to a regular expression in a string. Introduction to the PHP preg_match_all() function The preg_match_all() function searches for all the matches to a regular expression in a string. Unlike the preg_match() function that stops searching…
Read more

PHP preg_match

PHP preg_match Summary: in this tutorial, you’ll learn about the PHP preg_match() function to match a regular expression. Introduction to the PHP preg_match() function The preg_match() finds the string for a match to a regular expression. The preg_match() function stops searching as long as it finds the first match. Here’s the syntax of the preg_match()…
Read more

Regex Lookbehind

Regex Lookbehind Summary: in this tutorial, you’ll learn about the regex lookbehind and negative lookbehind. Introduction to the regex lookbehind Suppose you have the following string: ‘2 chicken cost $40’; Code language: JavaScript (javascript) And you want to match the number 40 after the $ sign but not the number 2. To do that, you…
Read more

Regex Lookahead

Regex Lookahead Summary: in this tutorial, you’ll learn to use the regex lookahead and negative lookahead. Introduction to the regex lookahead Sometimes, you want to match A but only if it is followed by B. For example, suppose you have the following string: 2 chicken weigh 30lb Code language: PHP (php) And you want to…
Read more