Web development and programming questions and answers

People's Q&A on programming or web development questions, answered quickly and constantly updated

552

PHP form inline validation

Hi I'm having a slight problem in creating an inline form via server-side validation. I have two files, index.php which I am using as a controller to add data t

Read More

810

php - Merge/Flatten 3rd level data to create an array of arrays

I have an array with 3 levels and I'd like to merge/flatten all 3rd level subarrays into one subarray/row on the 2nd level. $array = [ [ 'User' =>

Read More

209

php - I want to extract grades from this array containing subject and grades into an array

I am trying extract the grades e.g C5,C6 into another array from a string. Sample given below String: $str = "English Language-C5,Mathematics-C6,Economics-B3,B

Read More

450

javascript - How to properly handle UTF-8 in PHP?

I'm trying to get our chat system to support UTF-8, but I'm failing. If, on the client side, I send the following message, passed throughencodeURIComponent: îû

Read More

323

Intellij syntax highlighting of javascript and php in the same file

I have a JavaScript file that needs to have some PHP tags in it. Something like this: var chart = { init: function() { ... drawChart(this.data); .

Read More

117

java - jQuery webcam refresh. Wait for request to finish

As I talk about befor I'm using to jQuery to refresh / update a webcam image. This works just fine if you wanna update the image every 5th or 10sec. But when yo

Read More

834

java - php behavior when post_max_size exceeded

I understand that if a POST request exceeds post_max_size, the $_POST and $_FILES superglobals become empty. I've seen plenty of discussions about how to detect

Read More

526

php - Script to match names submitted via a form with MySQL database breaks when name contains apostrophe

I have script that enters names into a MySQL database, using mysql_real_escape_string so that apostrophes are handled correctly. The trouble I am experiencing i

Read More

328

php - Cache previous search for JSON updated hourly

I have a service that pulls from a weather API which only allows me to call it 500 times a day as I can't find any good free weather APIs that have hourly data.

Read More

528

php - remove lex tag block from string

Hello i have this lex parser template which contains a callback tag which i want to be removed because i get an infinite loop. I tried with phppreg_replace but

Read More

841

php - 500 Internal Server Error... browser-specific?

It is my understanding that a response code of 500 means that the server encountered an error, possibly a misconfiguration or a timeout. On my current project I

Read More

172

php - WooCommerce isn't pulling attribute anymore

Since updating Wordpress ( 4.9.4 ) / WooCommerce (3.3.1), for whatever reason the code below doesn't render the attribute value for 'Crane' associate to the ite

Read More

117

php - Example data from Google Analytics API response

I need to create my custom view for data from Google Analytics but I don't have any access to any data for API tests. Is there any place where can I find sample

Read More

323

javascript - How can I add a function as an action on a Leaflet layer?

I have a leaflet map and some functions where I parse the data from JSON. When I click on the "Parcuri" button from the layers button, I want to display the dat

Read More

201

php - Finding closest aggregated value using Knapsack or foreach

I am looking for the simplest solution for my problem that would also be most time efficient on the server. I have a value I have to approach to as close as po

Read More