Skip to content

Tag: php

Best way to manage long-running php script?

I have a PHP script that takes a long time (5-30 minutes) to complete. Just in case it matters, the script is using curl to scrape data from another server. This is the reason it’s taking so long; it has to wait for each page to load before processing it and moving to the next. I want to be able

PHP “&” operator

I’m not a PHP programmer (but know other languages), and I’m trying to understand a web page that was done in PHP (5.1.6) in order to do some changes. The page has the following code (simplified): $…

could static members use nonstatic members and vice versa?

could i use nonstatic members inside a static method? eg. and vice versa that is to say use static members inside non-static methods? Answer From http://php.net/manual/en/language.oop5.static.php Declaring class properties or methods as static makes them accessible without needing an instantiation of the clas…

Check if an array contains a specific value?

I’d like to check if there is a value on an array like this: I’ve read the check_value_new method is a better way to work with arrays, but I’m not used to work with it, how I should fix it? Answer PHP offers a function called in_array that checks if a value exists in a given array. You can c…

Change the maximum upload file size

I have a website hosted on a PC I have no access to. I have an upload form allowing people to upload mp3 files up to 30MB big. My server side script is done in PHP. Every time I try and upload a file, I receive an error claiming that the file exceeds the maximum size allowed, so I need

Google Google App Engine for static files in Joomla

I want to use Google App Engine for the static data for my Joomla website. I want to host all the CSS and JS files on App Engine. Answer Joomla is written using PHP. By default Google App Engine only supports applications written in Python, and in the future Java. See Google App Engine FAQ so PHP is not nativ…

PHP case-insensitive in_array function

Is it possible to do case-insensitive comparison when using the in_array function? So with a source array like this: $a= array( ‘one’, ‘two’, ‘three’, ‘four’ ); The following lookups would all …