Skip to content

Tag: arrays

JS Regex named groups with replace()

In JS, I’m trying to build an object from the below code. However I’m stuck at getting regex named groups with the below replace function. NOTE: What I’m trying to do is, Select characters from str variable from “:” to “,” and replace it with formatters values. Then m…

Simple if statement returning unexpected value

So I have this simple if statement with an input from an array: var_dump() returns: Seems simple right? Termijn is set to 2 in the array and the if statements set jaarlijks to selected well it doesn’t matter if I use 0, 1 or 2 as inputs it always sets jaarlijks to selected Answer Assuming this is still …

How can I get each value of array in PHP?

I get an endpoint which take some products of the database. That’s endpoint brings a JSON which looks like this: So, I need to make a table which shows colour[0] with size[0], colour[1] with size[1], etc. The main problem is that I can’t access by the name of the column (size and colour), because …