Skip to main content

Posts

Showing posts with the label php

Populate Whatsapp Link Based on Seller Phone Number WCFM

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 ...

How to easily parse PHP array to Javascript Array

Hi All, how are you doing? Stucked? Haa. Today i'm going to share with you how to easily parse a PHP array to Javascript array! Let's say we have a php array with key pair values defined. Example We want to change it to javascript object. first we will need to parse the array to json format Then we can use in javascript, either tru api or directly Same goes if we have an array of objects in PHP example Then we parse to json And access it in Javascript Hope this helps! Please leave some comment so that i can help it out~

Install php, apache, mysql on ubuntu

Salam. Hi there. today i installed php,apache,mysql on my ubuntu pc. I ve started my practical training last week. They asked me to do php on their current web application/system project. They do not allow me to use xamp. thus i ve to install one by one php,apache, and mysql.. on their windows. hurmp. the computer over there is really sick. lot of problems it took me two days to install and reinstall P.A.M (php,apache, and mysql-including gui) got conflict with previous installation and windows server call IIS(i really hate windows)...the actual duration for installing P.A.M are about 10-15 minute... huhuh ..longer.. compared to ubuntu.. it took only 5 minutes to install P.A.M .. only certain command . then yes! i can use those  P.A.M.. here i will share a bit .. what did i do to install P.A.M  1. Install apache. a. run terminal b. insert the following cmmd sudo apt-get install apache2   to check wether you have install correctly or the server (Apache) is w...