Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged function



« Prev 1 2 3 4
use anonymous function that returns parameter passed to it to evaluate functions, constants, and expressions in HEREDOC
0 74 posted 5 years ago by Queue
used ceil instead floor
0 68 posted 6 years ago by Balamir
Checks if two given arrays equal each other as php doesn't have a built in function for this.
0 62 posted 7 years ago by MaxHudson
To set cookie use "cookie('name of your cookie','cookie data','expire date ')" it will set your cookie in the user browser . To get the saved cookie use "cookie('name of your cookie')" it will give you the value of the cookie which you saved in the...
0 72 posted 7 years ago by kameshsoft
goes in the functions file
0 76 posted 7 years ago by thesmu
This function dosen't use curl, or any other libraries. Just include it in your function library and use it like this: $Post_result = _post('http://www.yourdomain.com/your_path/post_api.php',"method=fetchJson&params=select * from user");
0 84 posted 7 years ago by halk
This function will force a file to be downloaded. It accepts $_path as a parameter.
1 82 posted 7 years ago by o0110o
This function performs several checks to make sure it's getting the correct IP address.
1 126 posted 7 years ago by o0110o
A handy function to get the contents of a file with curl. Accepts $_path as a parameter.
1 88 posted 7 years ago by o0110o
This function will use curl to see if a file exists at the location it's provided. It accepts $_path as a parameter.
1 103 posted 7 years ago by o0110o
A function to get a files size via curl. Accepts $_path, $_unit, $_float, $_username & $_password; In the listed order.
1 109 posted 7 years ago by o0110o
This is a function to retrieve the mime-type of a file by checking the header response with curl. It accepts the file-path as a parameter & it also has a fallback for empty returns.
1 114 posted 7 years ago by o0110o
Use: echo format_size(filesize("fichier")); Example result: 13,37 Ko
0 65 posted 7 years ago by zhyar
Convert 12-hour time format with hour, minutes, seconds, and meridiem into 24-hour format. Performs data correction to make sure hours, minutes and seconds have leading zeros if needed. The trick here is to use strtotime() where we pass the time...
0 218 posted 7 years ago by kosinix
Function to prevent sql injection in Like queries, where the characters '_' and '%' can be dangerous.
0 96 posted 7 years ago by TimoZachi
Complete initialization for the new calendar class
0 59 posted 8 years ago by jdhall75
If you want to use this in a class, change the last line to: ` return array_map(array($this, __FUNCTION__), $object ); `
0 59 posted 8 years ago by jgomez
This is a function that receives a string as an argument (along with other config optional arguments) and locates all keywords (words that appear most) from that string, returning the keywords as an array or as a string separated by commas. The funct...
2 334 posted 8 years ago by TimoZachi
A custom breadcrumb function for WordPress that I created for a client. You can pass 2 arguments, the first being the text you want to display in front of the breadcrumb and the second is to hide the home item in the breadcrumb It will give eac...
1 55 posted 8 years ago by krike
A couple of ideas and options...
0 47 posted 8 years ago by stefpretty
0 46 posted 8 years ago by sudden85
The function returns the "sanitized" version of user input. Use before putting variables into SQL code.
0 62 posted 8 years ago by nebojsac
Function to print breadcrumb links
1 60 posted 9 years ago by stewartduffy
0 73 posted 9 years ago by olemedia
How to get a category id from the name of the category
0 45 posted 9 years ago by athanassiadis
A print_r replacement function that can handle nested arrays and strings. Usage: printr($array);
0 52 posted 9 years ago by tasmanweb
« Prev 1 2 3 4