Skip to content

Tag: php

Can a switch statement take two arguments?

is it posible for a PHP switch statement to take 2 arguements? For example: Many thanks, I haven’t done PHP in years! Answer No, but if your case is as simple as what you have, just concatenate the two inputs and test for the concatenated values:

Combine two arrays

I have two arrays like this: I want to combine these two array such that it does not contains duplicate and as well as keep their original keys. For example output should be: I have tried this but it is changing their original keys: Any solution? Answer Just use: That should solve it. Because you use string k…

jQuery Ajax post to php not catching variable

What am i doing wrong. PHP doesn’t seem to catch title and wrapper from $.ajax. Does the code look correct. The success message i get indicate an error that title is not found. jQuery main.html PHP process.php Answer Take a look: jQuery.ajax() The data parameter is better to be a Key/Value pairs object,…

locale for Switzerland (to correctly display Swiss Franc)

I’m looking for the locale to set in PHP for Switserland, for a client that needs support for Swiss Franc. I can’t seem to find the correct locale for Switserland. Does anyone know which one I can use? I need it in the following format like: nl_NL, en_US, en_GB Answer it depends on what language y…