Hi all, Image from Pexels Today I'm going to share, how to populate WhatsApp link based on the seller number. My example today is based on Malaysia's phone number. The registration input doesn't have an input validator for the phone number, however, these are the most common number registered by users. 1) starting with 6 at front 2) starting with +6 at front 3) normal number without country code eg : 014xxxxxx Full code on how to populate whatsapp link for seller number basically, I introduced a simple pattern that has 2 groups. "#(^[6]\w*$)|(^[+][6]\w*$)#"; The patterns must have a delimeter added for PHP, in my case i use a `#`. You can use other delimiter that supported by PHP . The first pattern (^[6]\w*$) Checks whether the seller phone number starts with number 6 and followed with other characters. If it is matched, do nothing as the format is already correct. The second pattern (^[+][6]\w*$) Checks whether the seller phone ...
This is a blog that shares tips on Coding, Website, E-Commerce, Windows, Linux and IT related infos.