PHP 8.0: Deprecate required parameters after optional parameters in function/method signatures

When define or declare function/method adding a required parameter after optional is deprecated. This happen from PHP 8.0 onward version. Deprecated: Required parameter $required_parameters follows optional parameter $optional_parameter in XYZ on line 123 Example function abc($optional_parameter = null, $required_parameters) { // ^^ optional parameter , ^^ required parameter } Solution…

Encode / Decode Base64 – PHP

With simple PHP function you can encode any string in to base64. It accept any string characters. Syntex base64_encode(string $string): string <?php $base64_encoded_string = base64_encode('ABCDECF"); // return value: QUJDREVDRg== ?> Deccode base64 String <?php $base64_encode_string = "QUJDREVDRg=="; base64_decode($base64_encode_string); // return value: ABCDECF ?>

How to find value in Array – PHP

You can easily find value in array with multple methods in array. Method 1 Method 1 - in_array function In array function will search for specific value in array and return TRUE if value found or FALSE in case of not value not found. <?php $cars = array("BMW", "mercedes", "audi",…
MongoDB installation on Windows

How to Install MongoDB Community Server on Windows

With few easy steps you can install MongoDB to your windows system. Lets start. Download MongoDB community version .msi File from here . Before you download make sure select latest or stable version, platform as windows and package as msi. Select MongoDB version and platform with package type 2. Once…