Alok Prasad has Published 52 Articles

What is traits in PHP?

Alok Prasad

Alok Prasad

Updated on 08-Nov-2023 10:43:18

2K+ Views

In 5.4 PHP version trait is introduced to PHP object-oriented programming. A trait is like class however it is only for grouping methods in a fine-grained and reliable way. It isn't permitted to instantiate a trait on its own. Traits are introduced to PHP 5.4 to overcome the problems of ... Read More

How to display errors in PHP file?

Alok Prasad

Alok Prasad

Updated on 07-Oct-2023 02:49:53

33K+ Views

A PHP application produces many levels of errors during the runtime of the script . So in this article, we will learn how to display all the errors and warning messages. The quickest way to display all php errors and warnings is to add these lines to your PHP code ... Read More

What is the use of ini_set() in PHP?

Alok Prasad

Alok Prasad

Updated on 29-Jun-2020 12:50:11

5K+ Views

PHP allows the user to modify some of its settings mentioned in php.ini using ini_set(). This function requires two string arguments. The first one is the name of the setting to be modified and the second one is the new value to be assigned to it.Parametersvar nameNot all the available ... Read More

Is PHP compiled or interpreted?

Alok Prasad

Alok Prasad

Updated on 29-Jun-2020 12:49:09

2K+ Views

Basically, PHP is interpreted but PHP is compiled down to an intermediate bytecode that is then interpreted by the runtime Zend engine.PHP compiler is responsible forconvert the code to a bytecode that can be used by the runtime engine.resolve functions, names and classes namescreating a symbol tablePHP Interpreter doesGoes through ... Read More

Differentiate between exception and error in PHP

Alok Prasad

Alok Prasad

Updated on 29-Jun-2020 12:48:40

1K+ Views

Let's discuss the differences between errors and exceptions.Recovering from Error is not possible. The only solution to errors is to terminate the execution. Whereas we can recover from Exception by using either try-catch blocks or throwing an exception back to the caller.You will not be able to handle the Errors ... Read More

What do we mean by hash functions in PHP?

Alok Prasad

Alok Prasad

Updated on 29-Jun-2020 12:26:55

176 Views

A hash function is any function that can be used to map data of arbitrary size to data of a fixed size. The values returned by a hash function are called hash values, hash codes, digests, or simply hashes.Syntaxstring hash( string $algo , string $data [, bool $raw_output = FALSE ... Read More

What is Exception Handling in PHP ?

Alok Prasad

Alok Prasad

Updated on 29-Jun-2020 12:05:32

245 Views

An exception is a problem that arised during the execution of a program. During the execution of a program when an exception occurs, code following the statement will not be executed, and PHP will attempt to find the first matching catch block. If an exception is not caught, a PHP ... Read More

What is the meaning of a Persistent Cookie in PHP?

Alok Prasad

Alok Prasad

Updated on 29-Jun-2020 12:04:35

760 Views

A persistent cookie is a cookie that is stored in a cookie file permanently on the browser's computer. As we know cookies are small text files which are as a matter, of course, temporary cookies which stored only in the browser's memory. When the browser is closed, temporary cookies will ... Read More

Program to find how many times a character appears in a string in PHP

Alok Prasad

Alok Prasad

Updated on 29-Jun-2020 11:59:22

1K+ Views

Example Live DemoOutputw appears 1 times e appears 2 times l appears 2 times c appears 1 times o appears 4 times m appears 1 times t appears 4 times u appears 1 times r appears 1 times i appears 2 times a appears 1 times s appears 1 times p appears 1 times n appears 1 times

What is .htaccess in PHP?

Alok Prasad

Alok Prasad

Updated on 29-Jun-2020 11:58:23

7K+ Views

.htaccess is a configuration file for use on web servers running on the web apache server software. when a .htaccess file is placed in a directory which in turn loaded via the Apache web server, then the .htaccess file detected and executed by the Apache server software. .htaccess files can be ... Read More

Advertisements