How-to articles, tricks, and solutions about PHP
The PHP error "Notice: Use of undefined constant" means that you are trying to use a constant that has not been defined yet.
This error message is indicating that there is a problem with the syntax of the code, specifically a parse error, and that it was unexpected to find the token "T_PAAMAYIM_NEKUDOTAYIM" in that particular place in the code.
mod_php is an Apache module that allows PHP code to be executed directly by the Apache web server.
PHPSESSID is a session cookie that is used to identify a user's session on a website.
In PHP, stdClass is a predefined class, which is part of the PHP standard library
In PHP, public, private, and protected are access modifiers that control the visibility of class properties and methods.
In PHP, single-quoted strings and double-quoted strings are very similar, with a few key differences.
In PHP, the "|" and "||" operators are both bitwise and logical operators.
Here is a short tutorial representing to you the most accurate PHP equivalent of .Net/Java’s to string. Read it carefully and check out the examples.
In PHP, a thread-safe version of PHP is built with additional constructs to ensure that certain actions are atomic, which means that they are performed in their entirety without any other thread being able to interfere.
In PHP, "++$i" is the pre-increment operator and "$i++" is the post-increment operator.
net::ERR_HTTP2_PROTOCOL_ERROR is an error that occurs in the Google Chrome browser when there is an issue with the HTTP/2 protocol.
Memcache and Memcached are both in-memory key-value stores that are commonly used to cache data to improve application performance.
This snippet is dedicated to the the main ways of using self and $this keywords in PHP. Here, you will learn how to use them and their main differences.
In PHP, $_SESSION variables are typically stored on the server in a file or a database.
This tutorial is dedicated to an issue that any developer may come across. It’s where to find the php.ini file. Choose among the three methods provided.
The object operator "->" is used in PHP to access a property or method of an object.
In this short tutorial, we are going to represent to you how to find where the PHP error log is located.
In XAMPP, the error log for PHP is typically located at {xampp-install-directory}/php/logs/php_error_log.
On Mac and Mac OS X, the localhost folder is located at:
On Ubuntu, the location of the php.ini file depends on the version of PHP you have installed.
On a CentOS system, the php.ini file is usually located in the /etc directory.
Composer stores global packages in the "vendor/bin" directory within your system's home directory.
There are several ways to check if an array has more than one element in PHP.
PHP's mkdir() function, which is used to create a new directory, defaults to using the server's current umask setting when determining the permissions of the newly created directory.