Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year. Improve this question Folks, For the n-th time in a row, i’m hitting the same old problem again. It’s about “how do I map OOP
PHP expects T_PAAMAYIM_NEKUDOTAYIM?
Does anyone have a T_PAAMAYIM_NEKUDOTAYIM? Answer It’s the double colon operator :: (see list of parser tokens).
geoip + pecl + 64 bits box
Has anyone tried to install geoip over pecl on a 64bits box? I can install geoip just fine using these commands on my 32bits fedora box. I can’t on the 64bits version. Any ideas why? yum install make gcc cpp gcc-c++ glibc glibc-headers php-pear php- devel geoip geoip-devel pecl install geoip => on the 64bits version it breaks here with
How do you reindex an array in PHP but with indexes starting from 1?
I have the following array, which I would like to reindex so the keys are reversed (ideally starting at 1): Current array (edit: the array actually looks like this): How it should be: Answer If you want to re-index starting to zero, simply do the following: If you need it to start at one, then use the following: Here are
How do I create a PDO parameterized query with a LIKE statement?
Here’s my attempt at it: Answer Figured it out right after I posted:
Dividing with a remainder in PHP
I have a part in my code where I need to divide and have a remainder instead of a decimal answer. How can I do this?
MySQL Great Circle Distance (Haversine formula)
I’ve got a working PHP script that gets Longitude and Latitude values and then inputs them into a MySQL query. I’d like to make it solely MySQL. Here’s my current PHP Code: if ($distance != “Any” &…
How to use $_SERVER[‘REQUEST_URI’]
Is there any difference between typing: or or ? They all work… I use the first one. Maybe one is faster than the other? Answer Without quotes PHP interprets the REQUEST_URI as a constant but corrects your typo error if there is no such constant and interprets it as string. When error_reporting includes E_NOTICE, you would probably get an error
Creating two pdf pages with Imagick
Currently i can create PDF files from images in Imagick with this function And it’s possible to fetch multiple pages with imagick like this But is it possible to save two image objects to two pages? (example of what i am thinking, its not possible like this) Answer I know this is long past due, but this result came up
Calling a function from a string in C#
I know in php you are able to make a call like: Is this possible in .Net? Answer Yes. You can use reflection. Something like this: With the above code, the method which is invoked must have access modifier public. If calling a non-public method, one needs to use the BindingFlags parameter, e.g. BindingFlags.NonPublic | BindingFlags.Instance: