Search Results

  1. Frequently Asked Questions

    • How to Prevent SQL Injection in Php?
    • How to Check If A String Contains A Specific Word?
    • Why Not to Use mysql_* Functions in Php?
    • How to Delete An Element from An Array in Php?
    • When to Use Self Over $this?
    • How to Get Php Errors to Display?
    • How to Make A Redirect in Php?
    • How Do You Use Bcrypt For Hashing Passwords in Php?
    • How to Use Php to Get The Current Year?

    Answer: Use prepared statements and parameterized queries. These are SQL statements that are sent to and parsed by the database server separately from any parameters. This way it is impossible for an attacker to inject malicious SQL. You basically have two options to achieve this: i. Using PDO(for any supported database driver): ii. Using MySQLi(fo...

    Answer: You can use the strpos()function which is used to find the occurrence of one string inside another one: Note that the use of !== false is deliberate (neither != false nor === true will return the desired result); strpos() returns either the offset at which the needle string begins in the haystack string, or the boolean false if the needle i...

    Answer: The MySQL extension: 1. Is not under active development 2. Is officially deprecatedas of PHP 5.5 (released June 2013). 3. Has been removed entirely as of PHP 7.0 (released December 2015) 3.1. This means that as of 31 Dec 2018it does not exist in any supported version of PHP. If you are using a version of PHP which supports it, you are using...

    Answer: There are different ways to delete an array element, where some are more useful for some specific tasks than others. Delete one array element If you want to delete just one array element you can use unset() or alternatively \array_splice(). Also if you have the value and don’t know the key to delete the element you can use \array_search()to...

    Answer: Use $this to refer to the current object. Use self to refer to the current class. In other words, use $this->member for non-static members, use self::$memberfor static members. Here is an example of correct usage of $this and selffor non-static and static member variables: Here is an example of incorrect usage of $this and selffor non-stati...

    Answer: You can do as following: However, this doesn’t make PHP to show parse errors – the only way to show those errors is to modify your php.ini with this line: (if you don’t have access to php.ini, then putting this line in .htaccessmight work too):

    Answer: i. Basic answer You can use the header() function to send a new HTTP header, but this must be sent to the browser before any HTML or text (so before the declaration, for example). ii. Important details die() or exit() Why you should use die() or exit(): The Daily WTF Absolute or relative URL Since June 2014 both absolute and ...

    Answer: bcrypt is a hashing algorithm that is scalable with hardware (via a configurable number of rounds). Its slowness and multiple rounds ensure that an attacker must deploy massive funds and hardware to be able to crack your passwords. Add to that per-password salts (bcryptREQUIRES salts) and you can be sure that an attack is virtually unfeasib...

    Answer: You can use either date or strftime. In this case, it doesn’t matter as a year is a year, no matter what (unless there’s a locale that formats the year differently?) For example: On a side note when formatting dates in PHP it matters when you want to format your date in a different locale than your default. If so, you have to use setlocale ...

  2. Frequently asked PHP questions The following collection is a community driven project of qualified and unbiased answers to the most frequently asked questions about PHP.

  3. PHP FAQs with interview questions and answers to be successful in Interviews. A collection of FAQs for learning PHP Programming and Tips on Interview provides PHP FAQs.

  4. Apr 28, 2026 · phpMy FAQ 4.1 A mobile-friendly, feature-rich, AI-ready open source FAQ web app for PHP 8.3+. Free since 2001.

  5. Learn PHP with W3Schools, a comprehensive tutorial featuring examples and an online editor to help you master PHP programming.

  6. People also ask

  7. phpMyFAQ - Open Source FAQ web application for PHP 8.3+ and MySQL, PostgreSQL and other databases - thorsten/phpMyFAQ

  1. People also search for