Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged php



1 ... 5 6 7 8 9 ... 58
Get Current URL Path on Apache / IIS
2 1627 posted 12 years ago by rickygri
This is a script for a validating Email.
0 1031 posted 12 years ago by laxman2021
This is a static session wrapper that handles single variables and arrays. It allows setting, resetting, and deleting session variables (without destroying the session). It regenerates the session id every time a session is started to prevent sessi...
0 1175 posted 12 years ago by halk
/** * THIS FUNCTION WILL RENDER A CONTAINER OR SELF-CLOSING HTML ELEMENT. * IT AUTO DETECTS WHAT TYPE YOU WANT * BASED ON RATHER OR NOT YOU SET A _data KEY IN THE ARRAY OF * ATTRIBUTES PASSED TO THE FUNCTION * * USING AN ASSOCIATIVE ARRA...
0 1179 posted 12 years ago by halk
https://gist.github.com/4098493 (examples of use below the class code) This class allows you to load a file of snippets that are really mini-templates copy them from your repository fill the token slots in them the with your data and render them as...
0 1238 posted 12 years ago by halk
Does not require http in the text to link. It must start with www however. Optionaly make the links popup in a new window.
0 1595 posted 12 years ago by halk
Use it similar to in_array function of PHP.
0 1361 posted 12 years ago by kosinix
This PHP removes menu items from the WordPress dashboard
0 1073 posted 12 years ago by ecksteing
# Método setter y getter Hace mucho tiempo usaba esta manera para tener un solo método que sea getter y setter al mismo tiempo.
0 693 posted 12 years ago by prigazzi
goes in the functions file
0 1089 posted 12 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 1278 posted 12 years ago by halk
A function to upload an image to the media library and set it as featured image of a post. It requires 2 params. The name of the upload field and of course the post ID. This function is part of the WPelements library class available on Github. Fee...
0 1452 posted 12 years ago by krike
A usefull function to minify code or string. This is part of the WPelements library class available on Github. Feedback / suggestions / improvements are welcome.
0 939 posted 12 years ago by krike
Take control of HTTP header status codes.
1 1260 posted 12 years ago by o0110o
Works, even if a locale is not avaliable on the system.
0 1085 posted 12 years ago by chatelao
Want to be able to display the source code of any webpage, with line numbering? Here is a simple code snippet to do it. Just modify the url on line 2 at your convenience. Or even better, make a pretty function according to your needs.
2 1177 posted 12 years ago by o0110o
If you need to get the whois information for a specific domain, why not using PHP to do it? The following function take a domain name as a parameter, and then display the whois info related to the domain.
1 1152 posted 12 years ago by o0110o
In order to optimize your scripts, you may definitely want to know how many amount of RAM they use on your server. This snippet will check memory and then print initial, final and peak usages.
3 983 posted 12 years ago by o0110o
Point the script to an image and get its dominant color.
1 1601 posted 12 years ago by o0110o
Add this to functions.php and then you can call the focus keyword anywhere you want with: <?php wpseoFocusKW();?>
0 1324 posted 12 years ago by itsmrchris
How to insert the less preprocessor script in WordPress Websites and Blogs
0 1074 posted 12 years ago by ecksteing
If you are a PHP developer, you are probably aware that you can pass an array of strings as the search strings and an array as the replacements to the str_replace function. In this example you can see how to automatically replace smiley shortcuts by...
1 753 posted 12 years ago by martijnhoogwerf
Simple method to insert data to sql
0 857 posted 12 years ago by BergBenji
This function will compress any text-based content.
1 961 posted 12 years ago by o0110o
Get the text in between more text in a string. Accepts $content,$start,$end & $is_string as parameters.
1 1070 posted 12 years ago by o0110o
Get the absolute webroot URL.
1 1231 posted 12 years ago by o0110o
This function will force a file to be downloaded. It accepts $_path as a parameter.
1 1218 posted 12 years ago by o0110o
This function performs several checks to make sure it's getting the correct IP address.
1 1479 posted 12 years ago by o0110o
A handy function to get the contents of a file with curl. Accepts $_path as a parameter.
1 1384 posted 12 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 1621 posted 12 years ago by o0110o
1 ... 5 6 7 8 9 ... 58