Welcome To Snipplr
Everyone's Recent Snippets Tagged function
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
If you want to use this in a class, change the last line to:
` return array_map(array($this, __FUNCTION__), $object ); `
0
776
posted 12 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
3176
posted 12 years ago by TimoZachi
By not being limited to provide certain arguments/parameters in right order when calling a function, makes the function more versatile and easier to extend without breaking old code (e.g. calls to the function).
One solution is to pass an associati...
0
988
posted 12 years ago by coprolit
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
752
posted 13 years ago by krike
This is a jQuery custom function used for clearing the default input values of input fields without having to add a class or inline javascript like onclick or onblur. Just write your input and give it a value like you normally would and then add this...
1
887
posted 13 years ago by thursday0384
Description: Execute different functions when the page loads in a better way than default onload JS event. Include it in the end of the JS document.
Arguments: Name of the function that you want to execute when the page loads.
Author: Simon Williso...
0
844
posted 13 years ago by alberomo
This snippet lets you call a Javascript function declared within an IFrame from the parent element of the IFrame
0
1607
posted 13 years ago by alexscript
Вывод 1: ЕÑли задать функцию через jQuery.fn, то она будет работать Ñ Ñлементами найденными через функцию $(). КонтекÑÑ‚ Ñтой функции будет ÑодеÑ...
0
688
posted 13 years ago by stancox
The function returns the "sanitized" version of user input. Use before putting variables into SQL code.
0
820
posted 13 years ago by nebojsac
A print_r replacement function that can handle nested arrays and strings.
Usage: printr($array);
0
707
posted 13 years ago by tasmanweb
Parses a url correctly even with a url as query parameter, also retuns dirname, basename and extension besides the other parse_url bits. See comments for more info.
0
919
posted 13 years ago by tasmanweb
Returns the number of days in the month taking leap-years into account.
0
851
posted 13 years ago by tasmanweb
A better and more accurate function to see if a value is an integer.
0
739
posted 13 years ago by tasmanweb