Welcome To Snipplr


Everyone's Recent PHP Snippets



1 ... 138 139 140 141 142 ... 147
These two functions allow you to remove images from html page. The function returns an array of images with the absolute src and,if there are any, the alt and title attributes. Arguments to pass to get_images() are $file = html source and $url = th...
3 2251 posted 18 years ago by gandalf
Display first article one way and following ones a different way
3 1869 posted 18 years ago by JuliaKM
5 1911 posted 18 years ago by jrphelps
Genera links en base a http, www, ftp
2 2134 posted 18 years ago by nicolaspar
Sometimes you need to have an ability to show limited number of elements in your select objects or sort elements by name or so. I figured out that this feature was added to object_select_tag later so that not everybody knows about that. This featureâ...
1 1464 posted 18 years ago by ggb2g
0 1296 posted 18 years ago by WimLeers
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 2079 posted 18 years ago by wattz
3 1653 posted 18 years ago by JuliaKM
2 1523 posted 18 years ago by WimLeers
1 1461 posted 18 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 1430 posted 18 years ago by Todd
With thanks to joshk :)
4 1859 posted 18 years ago by WimLeers
With thanks to emspace for the original code :)
1 1566 posted 18 years ago by WimLeers
With thanks to emspace for the original code :)
3 1806 posted 18 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 2581 posted 18 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 3525 posted 18 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 1954 posted 18 years ago by berkes
17 10950 posted 18 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 12621 posted 18 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 1962 posted 18 years ago by lmcdougall
Strip out non-alphanumeric characters. Very useful for use with filenames.
3 2003 posted 18 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 1923 posted 18 years ago by berkes
2 1588 posted 18 years ago by nicolaspar
1 ... 138 139 140 141 142 ... 147