Welcome To Snipplr
Everyone's Recent PHP Snippets Tagged php
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
This is a simple class to encapsulate CURD functions. This class also includes some simple search methods.
1
561
posted 15 years ago by ecavazos
Когда нет под рукой дебаггера, а вÑÑ‘-таки хочетÑÑ Ð¿Ð¾Ñмотреть дамп маÑÑива или объекта,
приходит на помощь print_r() в коде… да вот вид не оче...
0
403
posted 15 years ago by DeadLy
Arbol usado para mostrar categorias dentro de una lista
Cat1
==subcat11
Cat2
==subcat21
====subcat211
0
422
posted 15 years ago by lisandro
This function allows you to limit the amount of a string, like a sample from a post.
Create a file like function_lmt_txt.php and include it to use it.
Any comments to improve this are welcomed.
1
417
posted 15 years ago by bioascii
You can combine them with this: http://snipplr.com/view/4848/underscore-strings/
0
7518
posted 15 years ago by Abe
Add these lines to Drupals settings.php. Probably works on other systems, then Drupal too.
1
563
posted 15 years ago by berkes
Created for my own purposes, thought I'd share though ;)
copy paste at the top of your file and it does the magic :)
31
3527
posted 15 years ago by peteypablonz
MyActiveRecord is a stand alone db abstraction layer to simplify things between php and mysql. you can download the latest version from www.wattz.net
0
594
posted 15 years ago by wattz
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
422
posted 15 years ago by Todd
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
820
posted 15 years ago by andyhartleeds
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
2825
posted 15 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
614
posted 15 years ago by lmcdougall
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
531
posted 15 years ago by berkes