Tag php

[Solved] Creating HTML table with php output

Your issues lies in your formatting and confusion between the use of the echo command and non PHP wrapped HTML. Code should read as follows when properly formatted. <?php $db_host = “localhost”; $db_username = “vistor”; $db_pass = “visitor”; $db_name =…

[Solved] Complicated regex in PHP

try this: <?php $q1 = “{Hello|Hi} sir.”; $q2 = “{How are you?|How are you doing?}”; $q = substr($q1, 1, strpos($q1,’}’)-1); $q_end = substr($q1, strpos($q1, ‘}’)+2); $parts = explode(‘|’,$q); echo “<select name=\”q1\”>\n”; foreach($parts as $part){ echo “\t<option value=\””.strtolower($part).”\”>$part</option>\n”; } echo “</select>\n”;…

[Solved] Browser detection in PHP causes white screen [closed]

This is my first comment here sorry if its not perfect. I think its because you’re trying to echo everything at once. <?php if (strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Firefox’) !== FALSE || strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Chrome’) !== FALSE || strpos($_SERVER[‘HTTP_USER_AGENT’], ‘Opera’) !== FALSE || strpos($_SERVER[‘HTTP_USER_AGENT’],…

[Solved] If in Array on PHP [closed]

I’m guessing you’re trying to find out if $catId is in the $result_2 array. If so, then you’ve already answered your question with your title here.. in_array if(in_array($catId,$result_2)) solved If in Array on PHP [closed]

[Solved] php add counter with thousands separator [closed]

Preety straight forward answer for you… <?php $fp = fopen(“counters”, “r”); $count = fread($fp, 1024); fclose($fp); $count = $count + 1; echo “<p>Pageview: ” . number_format($count) . “</p>”; // <=== $fp = fopen(“counters”, “w”); fwrite($fp, $count); fclose($fp); ?> 1 solved…

[Solved] mysql Search data from multiple table

Introduction MySQL is a powerful and popular database management system used by many businesses and organizations. It is capable of storing and retrieving data from multiple tables, allowing for complex queries and data manipulation. In this tutorial, we will discuss…