Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged function



« Prev 1 2 3
use anonymous function that returns parameter passed to it to evaluate functions, constants, and expressions in HEREDOC
0 839 posted 9 years ago by Queue
used ceil instead floor
0 613 posted 10 years ago by Balamir
Checks if two given arrays equal each other as php doesn't have a built in function for this.
0 601 posted 11 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 595 posted 11 years ago by kameshsoft
goes in the functions file
0 634 posted 11 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 781 posted 11 years ago by halk
This function will force a file to be downloaded. It accepts $_path as a parameter.
1 753 posted 11 years ago by o0110o
This function performs several checks to make sure it's getting the correct IP address.
1 984 posted 11 years ago by o0110o
A handy function to get the contents of a file with curl. Accepts $_path as a parameter.
1 889 posted 11 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 1021 posted 11 years ago by o0110o
A function to get a files size via curl. Accepts $_path, $_unit, $_float, $_username & $_password; In the listed order.
1 1036 posted 11 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 1247 posted 11 years ago by o0110o
Use: echo format_size(filesize("fichier")); Example result: 13,37 Ko
0 671 posted 11 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 3636 posted 11 years ago by kosinix
Function to prevent sql injection in Like queries, where the characters '_' and '%' can be dangerous.
0 843 posted 11 years ago by TimoZachi
Complete initialization for the new calendar class
0 656 posted 11 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 590 posted 11 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 2744 posted 12 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 570 posted 12 years ago by krike
A couple of ideas and options...
0 425 posted 12 years ago by stefpretty
0 513 posted 12 years ago by sudden85
The function returns the "sanitized" version of user input. Use before putting variables into SQL code.
0 633 posted 12 years ago by nebojsac
Function to print breadcrumb links
1 475 posted 12 years ago by stewartduffy
0 718 posted 12 years ago by olemedia
How to get a category id from the name of the category
0 649 posted 12 years ago by athanassiadis
A print_r replacement function that can handle nested arrays and strings. Usage: printr($array);
0 541 posted 12 years ago by tasmanweb
« Prev 1 2 3