Skip to content

Add tel: to phone number after calling it from database php

I’m using this to call phone number from database and hiding it with this : this is JavaScript i use to show and hide the phone number what I want is to add <a href=”tel:phoneNumber so the phone number will be clickable one the article page you can see the link here : https://www.lhawta.ma/clas…

How can I sort an array stating in a given number

First of all I am new in php. I need help to sort an array. I have an array of ID’s and zip codes like this: Now I have a number lets say ‘2900’ I would like to sort my array from the closest number (2900) to the most distant. Example: the number is 2900. So the array should sort

Limiting number of reservations per user with PHP and MySQL

My users are able to create a reservation, but I would like to limit it – let’s say one user can make max 5 reservations with “Pending” status, after Admin approves reservation and pending status changes to approve, the user can make another reservation. Pending status is given by defa…

getting html innertext in php

I want to get a innertext value in my html to store it in my php variable. So far I have this. This is my html code. I want to get innertext value of < p > which will show a float number calculated by my Javascript. In my php code I have this. I get Undefined variable error. What