i want to get only not null values count in that array , if i use count() or sizeof it will get the null indexes also . in my case i have an array like this Array ( [0] => ) the count is 1 . but i want to get the not null count , inthis case it should
php: converting number to alphabet and vice versa
So I have this function: function toAlpha($data){ $alphabet = array(‘a’,’b’,’c’,’d’,’e’,’f’,’g’,’h’,’i’,’j’,’k’,’l’,’m’,’n’,’o’,&#…
Best way to validate source of API request
I am trying to develop a PHP RESTful web service. What is the best way to securely validate the source of request? Firewall is an option but I want to do some application level validation.
Keep leading zeros with fgetcsv in PHP
I’m reading a .csv file (I have no control of the format of the file) and I’m trying to keep the leading zeros for the data in the resulting array. For instance, the .csv file has “0615” in …
What’s the simplest way to navigate through a list of images?
The purpose of this is to view remote images with a browser. I already have set apache and I can see the folder of pictures with directory listing. The bad thing, is that I have to click each image, each time I want to see one. What I want is to navigate through the images in the folder using the
Why does gettext translate an empty string to the .po header text?
I’ve got gettext setup within PHP5. After some struggling with the charactersets and the like, I’ve managed to translate some basic strings. Now I’ve ran into a problem. When translating an empty …
Understanding ‘parse_str’ in PHP
I’m a PHP newbie trying to find a way to use parse_str to parse a number of URLs from a database (note: not from the request, they are already stored in a database, don’t ask… so _GET won’t work) So I’m trying this: Please note that here I am just supplying an example URL, in the…
php how to store and read json data via mysql?
php how to store and read json data via mysql? then, how to update data value? read out the data, then insert it with an json_encode and decode process, or only easy way update? then insert another change to [{“id”: “1”, “value”: “yes”},{“id”: “…
CodeIgniter: Preventing row_array() vs row() typo’s?
Twice now I’ve mistakenly used row() instead of row_array() when fetching a single row result. Usually, it goes unchecked without any warning messages. 15-30 minutes later I finally notice the issue; …
Can enctype=”multipart/form-data” be used for non file inputs as well?
Is this allowed? It will be used with PHP… Answer Yes, it’s absolutely correct. No issues.