Category: Php Programming course

The Most Important PHP functions

There are hundreds of functions in PHP, but most of them are rarely or never used. In the following you will find the most important PHP functions. For a complete list of features, see the Function Guide . array functions array_key_exists($key, $array)  - Check if a key exists in an array. arsort($array)  - Sort an array in reverse order and [...]

Read More

PHP Lesson 25 – Constant – PHP Tutorials

php constant The value of a constant is, unlike a variable, no longer changeable once it has been defined. This is useful, for example, to define fixed, immutable values, such as the maximum length of a post or the version of your script. Constant Syntax - PHP Tutorial To define a constant, you use the keyword const, You can [...]

Read More

PHP Lesson 21: How to create Fuctions Example

php functions So far, we have mainly used functions that provide PHP. This tutorial is about writing and using your own functions. Often you have a certain programming problem that occurs in several places, for example, you want to calculate values of a certain mathematical function in several places of your scripts. Here every time to copy [...]

Read More

PHP Lesson 20: How to set PHP Session Example – session_start(), session_destroy(),session_start()

php session HTTP is a stateless protocol, meaning information is not cached between the various views of a visitor. This is, of course, impractical if we need to store certain information about a visitor, for example, which username he logged in with. To solve this, you use PHP sessions. Technical background - PHP Session Sessions give you [...]

Read More

PHP Lesson 19: Search and replace strpos(), strlen(), str_replace(), str_ireplace()

With PHP you can also search texts, and replace certain characters/words with another text. If you want to check if some text is contained in another text, you can use the function strpos($text, $searchtext) at. This returns the position of the first occurrence if the searched text exists. If the text does not exist, false is returned. <?Php $text = "This [...]

Read More