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…
PHP script not working in HTML file
I’m new to PHP. I installed XAMPP and have Apache running. I created helloworld.php in XAMPP’s htdocs and got PHP to display in my browser. My question is, why does my PHP script in my HTML file not …
Sending POST Requests without waiting for response?
I am writing a simple REST service, which responds to requests from clients. All in PHP. My concern is, that when my server responds to a request, it could end up tying up resources if the client …
PHP check if variable is a whole number
I have this PHP code: $entityElementCount = (-($highScore-$totalKeywordCount))/0.29; What i want to know is, how to check whether $entityElementCount is a whole number (2, 6, …) or partial (2.33, …
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
.htaccess deny access to specific files? more than one
I am able to disable access to a file with .htaccess, but I don’t know how to disallow multiple files to be viewed (directly, not from includes) They are .php so I can’t disable a file type (like the only tutorials online say..) Or something.. For example “home.php, file.php , test.php”…
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 …
How well does FFmpeg scale? Any examples?
I’m currently working on the server side of an augmented reality project. It’s a lot like http://www.livingsasquatch.com/. I’m using PHP/MySQL and FFmpeg to capture the webcam video and encoding it to .flv. Basically Flash uploads the video as a long series of .jpg images. PHP then takes tho…
Group duplicate array keys in a multidimensional array into subarray
I have a multidimensional array called $songs, which outputs the following: Array ( [0] => Array ( [Michael Jackson] => Thriller ) [1] => Array ( …