Mask a portion of string in repeat with given character in Laravel PHP ( #shorts )

1 year ago
10

Hi Friends,

Mask a portion of string in repeat with given character in Laravel PHP

`Str::mask()` method is used to mask a portion of a string in repeat with given character. which helps in hiding full information for any particular value like email, phone etc.

Even you use a negative number as the third argument to the mask method, which will make mask method to begin masking at the given distance from the end of the string.

use Illuminate\Support\Str;

$string = Str::mask('tayson@exampledomains.com', '*', 3);

// tay**********************

$string = Str::mask('tayson@exampledomains.com', '*', -22, 3);

// tay***@exampledomains.com

#php #laravel #phplaravel #laravelmask #mask #single #instance #string #maskvalue #maskstring #maskemail #maskphone #javascript #string #javascriptstring #javascriptlearning #javascriptinterview #javascriptstringfunctions #stringfunctions #interview #interviewquestionsandanswers #question #answer #questionanswer #questionandanswer #shorts #trending #trend #popular #method #function #shorts #shortsfeed #shortvideo #short #shortsviral #viral #viralshort #viralvideo #viralshorts #chatgpt #openai #gpt3 #gpt4 #chatgpt4 #chatgpt3 #gta6 #princecheema_official @princecheema_official

Loading comments...