Loop through $_POST values

I have a very simple form on my website. I run this PHP to loop the form contents: echo ‘<pre>’; var_dump($_POST); echo ‘</pre>’; $i = 0; foreach($_POST as $key => $value) { $i++; echo $value[$i][‘row_id’]; } I get the below: array(1) { ["data"]=> array(2) { [1]=> array(2) { ["row_id"]=> string(5) "33714" ["sport"]=> string(8) "swimming" }… Read More Loop through $_POST values

Checking if a time range contains another time range in PHP

Hi Can you help me in my problem? checking if a time range contains another time range for example I have 2 time range: $nightShiftStart = strtotime("22:00:00 today"); $nightShiftEnd = strtotime("06:00:00 tomorrow"); $overTimeStart = strtotime("21:00:00 today"); $overTimeEnd = strtotime("07:00:00 tomorrow"); if I check if overtime start and end contains night shift schedule it should return… Read More Checking if a time range contains another time range in PHP

mb_split returning strange charadters for RTL

I’m trying to split Arabic words into array but it always return some strange characters. Here’s the code: <?php mb_internal_encoding("UTF-8"); function fatehah(){ $surah = " بِسْمِ ٱللَّهِ ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ ١ٱلْحَمْدُ لِلَّهِ رَبِّ ٱلْعَـٰلَمِينَ ٢ٱلرَّحْمَـٰنِ ٱلرَّحِيمِ ٣مَـٰلِكِ يَوْمِ ٱلدِّينِ ٤إِيَّاكَ نَعْبُدُ وَإِيَّاكَ نَسْتَعِينُ ٥ٱهْدِنَا ٱلصِّرَٰطَ ٱلْمُسْتَقِيمَ ٦صِرَٰطَ ٱلَّذِينَ أَنْعَمْتَ عَلَيْهِمْ غَيْرِ ٱلْمَغْضُوبِ عَلَيْهِمْ وَلَا ٱلضَّآلِّينَ ٧… Read More mb_split returning strange charadters for RTL

Including font awesome class in php table row based on a condition

I am working on this below php page and I am trying to include font awesome class when there is a certain condition met. But, getting the below error. Parse error: syntax error, unexpected ‘if’ (T_IF), expecting ‘;’ or ‘,’ here is the code foreach($result as $row) { echo ‘<tr> <td>’ if(.$row["FLAG"]=="1") { ‘<i class="fa-sharp… Read More Including font awesome class in php table row based on a condition