Welcome To Snipplr


Everyone's Recent PHP Snippets



Override yii's jquery files and load your own.
0 120 posted 5 years ago by federaik_
example of php code I worked on
0 194 posted 5 years ago by johnschneider
Adds a Logout link to the end of your Primary Navigation is the user is logged in; else adds a Login link to the end of your Primary Navigation.
0 146 posted 5 years ago by entreprenerds
Simple PHP search with whole word extract and highlighted search word
0 128 posted 5 years ago by flatearthcomms
In SQL I can get this by adding AND to the join LEFT JOIN installations i ON a.id = i.app AND i.page = :page This way I get the installation info for an app that has an installation on the page, but I get null values on the columns for app's that...
0 264 posted 5 years ago by satie83
Show a list of active plugins on current site. I use it for diplaying in ManageWP and transfer to documentation
1 176 posted 5 years ago by ellegaarddk
<p>Follow these steps to secure your Cakephp Website:</p> <p>*Before you actually start using Security Component functionality, make sure you use $components = array (‘Security’, ‘Auth’) in the array so you can extend its functionality in...
0 119 posted 5 years ago by cakephpexpert
Source: https://css-tricks.com/snippets/wordpress/customize-login-page/ Put them in your theme functions.php or make it a plugin.
0 128 posted 5 years ago by pauloc
Show a list of days between two dates, using native php DateTime functions
0 262 posted 5 years ago by snstro
This is a common model used to run some common functions like CRUD functions, get reference data from table, check for dependencies etc. So in other model, we don't have to add those function repeatedly
0 213 posted 5 years ago by invtr
To use WordPress 4 Customizer API I'd need just to do 2 steps: define a data in the array, and call a custom registering function.
1 175 posted 5 years ago by micklevin
This is the basic code that you need to know to connect and list data with PDO. Don't use de old method (mysql_connect and mysqli_connect) to connect and interact with databases.
0 156 posted 5 years ago by snstro
This is a little code snippet that I use in almost every project that isn’t based on a popular CMS. Since its fairly expensive to hit the database on every page load, its a smart idea to cache the plain HTML markup of your page and serve that up. Y...
0 123 posted 5 years ago by a1ias
Simple script to send SMS throught our HTTP API (Afilnet) with PHP. Steps: 1.- Register in Afilnet. http://www.afilnet.com/anunciante/registrar.php 2.- Login and get credits (10 free) to send SMS 3.- Use this script or html form example include in...
1 140 posted 5 years ago by Afilnet
Search and returns the first results on a regex search If we use parenthesized or subpattern, can return with $result_number
0 133 posted 5 years ago by jatubio
Build a regex expression to all array elements are present in any order. Gets an array of strings (Sample: array("Access Denied","error","could not be retrieved") Return sample: '(?=.*Access Denied)(?=.*error)(?=.*could not be retrieved)
0 131 posted 5 years ago by jatubio
Replaces spaces by '\s+' which means one or more spaces $string can be one string or one array of strings
0 123 posted 5 years ago by jatubio
Translate non alphanumeric characters into an underscore. Doesn't create double underscores if there's two spaces in a row. Also turns name to lowercase. Use with trim to avoid spaces at front or end.
0 113 posted 5 years ago by flatearthcomms
To retrieve the weather forecast for your location based only on your current IP, the full tutorial will have the following 5 sections (http://bit.ly/1A5Y651), that will: - Describe elements needed for weather forecast retrieval - Describe the weat...
0 111 posted 5 years ago by Hexahow
Sort & query arrays in PHP. Sort multi dimensional arrays by object properties and filter the array by specific criteria. Documentation: https://github.com/mattnicholson/DataList
1 149 posted 5 years ago by mattnicholson
The code below can be used to lookup IP address in bulk in return of geolocation information using PHP programming languages and MySQL database. In this tutorial, we use the IP2Location LITE database to lookup country of origin from the visitor's IP...
1 195 posted 5 years ago by Hexahow
Works with any array
0 176 posted 5 years ago by a1ias
Select aus vorhandenen Daten des Datenbankobjektes
0 86 posted 5 years ago by ulfinger
Use PHP's DOM parser to convert a table into plain text (including links with images)
0 242 posted 5 years ago by nigelnquande
This function takes HTML input and converts it to plain text. It needs improvement so that it converts multiple blank lines to a single blank line and converts an &lt;a ... &gt; link to the markup equivalent (same for images). It should be rewritten...
0 135 posted 5 years ago by nigelnquande
Bei Autocomplete aus größeren Datenbanken ist es sinnvoll, die Datenbankabfrage in eine separate php-Datei zu verlegen.
0 139 posted 5 years ago by ulfinger
Magento Testimonials extension add testimonials functinality to your store. Let everyone know what your customers think about your store. You can add photo, email, website url and rating to your testimonials. Show testimonials on sidebar or separa...
0 142 posted 5 years ago by steelgray9
Ultratabs extension will provide you with power to display, hide and change order of core Magento tabs on product details page. Such as: Description, Additional Information, Upsell Products List, Related Products List, Products Tags and Products Revi...
0 110 posted 5 years ago by steelgray9
codeigniter autocomplete
0 120 posted 5 years ago by shivrajgoa
codeigniter autocomplete
0 126 posted 5 years ago by shivrajgoa