Welcome To Snipplr


Everyone's Recent PHP Snippets



1 ... 139 140 141 142 143 ... 147
3 683 posted 16 years ago by JuliaKM
2 592 posted 16 years ago by WimLeers
Just a reminder to myself, not really a snippet. When running into memory/speed issues with PHP/MySQL apps, adjust the memory_limit parameter in php.ini.
3 554 posted 16 years ago by Todd
With thanks to joshk :)
4 683 posted 16 years ago by WimLeers
With thanks to emspace for the original code :)
1 600 posted 16 years ago by WimLeers
With thanks to emspace for the original code :)
3 686 posted 16 years ago by WimLeers
Step 1: Copy and paste the e-mail Form Code into a 'contact.php' page (must be a html/php page on a server that allows php!). Step 2: Copy n paste the sendeail.php code into a new file. Change the YourEmail section to include your email address. T...
3 1110 posted 16 years ago by jonhenshaw
How to check if a number is odd or even in PHP. Could also use the MOD (%) function, but apparently this method is better performance-wise.
12 1162 posted 16 years ago by andyhartleeds
Removes the core, and node styles from the $style variable. You most morbably already defined _phptemplate_variables($hook, $vars), in that case just add the two lines there. _sympal_theme.. is the name of the theme where we use this.
3 727 posted 16 years ago by berkes
17 4172 posted 16 years ago by lmcdougall
Ej: $ziper = new zipfile(); $filename1 = 'images/imagen1.jpg'; $filename2 = 'images/imagen2.jpg'; $fileZip = 'images/imagen.zip'; $ziper->addFile(file_get_contents($filename1),$filename1); $ziper->addFile(file_get_contents($filename2),$filename...
22 4112 posted 16 years ago by lmcdougall
A quick and simple way to search a MySQL database. Example: mysql_search('items', 'title tags', isset($_GET['q'])?$_GET['q']:'', Array('columns'=>'*', 'method'=>'OR', 'extra_sql'=>'AND active = "true" ORDER BY id DESC'));
5 874 posted 16 years ago by lmcdougall
Strip out non-alphanumeric characters. Very useful for use with filenames.
3 737 posted 16 years ago by andyhartleeds
Shortens a string, and adds a span with a title of the full string. Function is useful for listings where you don't want wraping; or for places where a long string liek a username can break the layout.
1 719 posted 16 years ago by berkes
2 648 posted 16 years ago by nicolaspar
simply adding the tags will display the contents of the array in a much better fashion.
0 1051 posted 16 years ago by scriptmakingcom
1 725 posted 16 years ago by JuliaKM
This snipped adds columnstriping to cells. It works fine for most cases, but will behave strange when combined with colspan. Cells get an additional class 'even-col' or 'odd-col'
2 801 posted 16 years ago by berkes
2 514 posted 16 years ago by JuliaKM
Email validation routine Dave Child
8 984 posted 16 years ago by IanLewis
This randomly displays 1 of the 5 arrays (amount of arrays to choose from can be reduced or increased)
3 823 posted 16 years ago by jonhenshaw
1 ... 139 140 141 142 143 ... 147