Welcome To Snipplr


Everyone's Recent PHP Snippets



1 ... 21 22 23 24 25 ... 148
Author: J. van Hemert Fixes encoding when utf-8-encoded data is stored in tables with other (e.g. latin_swedish_ci) encoding. Will convert all columns in all tables to utf8_general_ci.
0 605 posted 11 years ago by sjasliek
Add this bit of code to functions.php
0 368 posted 11 years ago by adiacone
Sometimes you just want a random link to display and outside of the default format, this works perfectly and removes all default html (list items / headings).
0 607 posted 11 years ago by crypticsoft
This needs to be run on an action, or at least I wanted able to get it to run outside of an action, I suggest template_redirect. More information at the link.
0 536 posted 11 years ago by FatFolderDesigner
paginar resultados con jquery y ajax, permite ingresar condiciones (where, like, =...) solo se ingresa el nombre de los campos de la base de datos que se desean listar ver opciones.
1 685 posted 11 years ago by rickyslow
From 'Andy' in the comments.
0 882 posted 11 years ago by rliverman
Remove noscript tag and will work
0 395 posted 11 years ago by bubaphex
Displays latest posts by current author (place it within the loop). Adapted from code from [here](http://www.wpbeginner.com/wp-tutorials/how-to-display-related-posts-by-same-author-in-wordpress/) and a tutorial [here](http://www.makeuseof.com/tag/how...
0 625 posted 11 years ago by certainlyakey
Complete initialization for the new calendar class
0 513 posted 11 years ago by jdhall75
The orignial calendar class code before the changes
0 443 posted 11 years ago by jdhall75
At line 220 you should see the the start if an if block. This is the section that needs to be edited. I added the foreach block to itterate over the data array and create links in the table cells.
0 546 posted 11 years ago by jdhall75
Initializing the update calendar class
0 451 posted 11 years ago by jdhall75
Template for for Codeigniter calendar class. Modified from default for css styling and multiple events per table cell.
0 551 posted 11 years ago by jdhall75
This function checks if the $stringComplete variable ends with the string $endString.
0 459 posted 11 years ago by satie83
A nice way to do sorting of a key on a multi-dimensional array - DavidG
0 659 posted 11 years ago by satie83
Add the below commented sections into the appropriate functions in your /app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php and you'll be good to go! This has been (personally) tested with 1.6.1.0
1 907 posted 11 years ago by ddavidd
add site name to the page title
0 557 posted 11 years ago by artaserse
Place startTime() at beginning where timing is to start. Get the return value and set the start time variable. At end of script to time call execTime($start) passing the start time and this will calculate elapsed time of execution.
1 513 posted 11 years ago by anagaiyahoocom
If you want to use this in a class, change the last line to: ` return array_map(array($this, __FUNCTION__), $object ); `
0 460 posted 11 years ago by jgomez
Obtiene un identificador usando el nombre del host, id del proceso PHP y usando uniqid. Además se agrega una ruta para ver cómo quedaría almacenada en disco la información.
0 327 posted 11 years ago by porquero
bloginfo('name') is a function that generates the name of a WordPress site, the one used in the installation of WordPress and inserted in the Blog Name field under General Settings.
0 239 posted 11 years ago by treociti
Converts a php object to an associative array
1 3522 posted 11 years ago by satie83
Abstract class from which other classes can be derived to handle database access and data retrieval. Constants for database connection (DB_DSN, DB_USERNAME, etc.) must be set in another php file (eg. config.php)
1 544 posted 11 years ago by osccar
This will give <ul> for the wordpress Menu
0 534 posted 11 years ago by Farhan
A useful function for different formats of time or if you are dealing with time in PHP code.
0 439 posted 11 years ago by visionlighter
Replaces all links within href part of anchor in a HTML-String.
1 2844 posted 11 years ago by rwunsch
Replace the code below in your templates 'media.phtml' file. This has mouseover and mouseout but can be removed it needed.
0 485 posted 11 years ago by TheJasonParker
// quick function to cut back on the length of content
0 424 posted 11 years ago by rliverman
Relies on "trunCate" a truncating function.
2 595 posted 11 years ago by rliverman
Thank you Jonathan Sampson for posting this on http://stackoverflow.com/questions/2050789/php-search-a-string-for-a-email-address
0 1008 posted 11 years ago by focal55
1 ... 21 22 23 24 25 ... 148