JWT - lcobucci/jwt 4.2.1 requires ext-sodium- PHP 7.4 - WAMP

JWT – lcobucci/jwt 4.2.1 requires ext-sodium- PHP 7.4 – WAMP

Error occurred when install composer on Laravel project with PHP version 7.4 Solution: Go to PHP.INI file at location wamp64\bin\php\php7.4.32 and edit with any editor Find extension name: sodium and enable it by remove semicolon in front of that Restart All services on Wamp server. After restart open new command…

Email issue – Connection could not be established with host

Problem: While send email it show Connection could not be established with host "ssl://email-smtp.us-east-1.amazonaws.com:587": stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:error:0A00010B:SSL routines::wrong version number Solution: Change Port number to 465 instead of 587 If you are using LARAVAL you can do this in .env file Instead of…

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",…