Skip to content

Tag: php

Fatal error when using foreach on 3rd array

I’m getting an error when trying to use foreach on 3rd array My goal is to get those data above and expect it to loop until its last data using this code: It returns this error Here is the line 25 Error on line 25 Am I missing something? By the way I’m working on a proxy dashboard for a

Subtract tax from a price with tax in OpenCart?

How do I subtract all taxes from a price with tax in OpenCart? In the example below I use the default “Taxable goods” tax setting from OpenCart, which is 20% VAT + $2,00 Eco-Tax. This returns an incorrect value of $14,64 because it calculates the tax on $number (20,80), which already is a price wi…

fputcsv() problem. Textarea isn’t saved in one column

Today, I found my limit in data operations knowledge. I can successfully save input fields as well as textareas by doing this: Later on, I can retrieve the data and store it in array by using explode()… or so have I thought! The problem is in me. I like BIG textareas. I am currently making a forum page …

Sort foreach results by html form input order

I have an html form that posts the content of an <input> field. This field accepts one or more values. If more than one value, then the user just separates with a blank space. Question: How can I sort the results by the exact order of the user input? E.g. User inputs the following by this specific order…

PHP string concat with slashes and variables

I am trying to exec an rclone command via a PHP script. The plain text version of the call looks like this: But when I run it, I’m missing a bunch of stuff and getting divide by 0 errors. I’ve tried a number of other combinations of / and ” and can’t quite get it dialed in. Answer If t…