You are here

snippet - PHP: Check url for valid response code 200
9 Jan, 2017
Check the HTTP Status Code of the website header using PHP. Check that url is giving valid response code of 2xx. You can modify this for different purposes. For detecting 404 not found only or...
snippet - Soap request with NTLM authentication
6 Dec, 2016
Doing private Soap reqests requires some kind of authentication. One of the most common ways is to use NTML authentication. PHP soap does not support this out of the box it. You can use this tftdias...
snippet - PHP: Download large file from url without loading it to memory
5 Dec, 2016
This snippet shows you how to download a file from url without loading it to memory. When you use file_get_contents() and file_set_contents() you load the content to memory and then to file. The...
snippet - Filename from path in PHP
22 Nov, 2016
Snippet shows you how to get filename from a path in PHP. Filename and extension separately. Can be used for extending filenames with timestamp or anything.
snippet - Select a random file from directory in PHP
22 Nov, 2016
Select a random file from directory. This can be useful if you want to display a random image on your website. For an example a background image randomly from a directory in your files.
snippet - Get body tag using PHP Dom Document
22 Sep, 2016
How to use a DOM parser and get the contents of the body.
snippet - Validate AJAX requests in Zend Framework
26 Aug, 2016
How to validate AJAX requests in Zend Framework. There is a function in request class, to use instead of comparing the $_SERVER['HTTP_X_REQUESTED_WITH'] directly. This can be beneficial for security...
snippet - Directo class
17 May, 2016
Class for fetching and sending data between API. This class includes pulling data from Directo and posting xml with php array to xml generation.
snippet - PHP: Trim Array
5 May, 2016
This snippet shows you how to trim an array with single line of code. This can be achieved by using "array_map".
snippet - SimplePie Error: timed out after 10001 milliseconds
8 Feb, 2016
SimplePie is set to 10 seconds timeout in default. So if the feed has problem with speed then you can increase the time. The exact error that I got was "cURL error 28: Operation timed out after 10001...