Welcome To Snipplr


Everyone's Recent PHP Snippets



1 ... 112 113 114 115 116 ... 147
A few days ago i was looking for a script witch one will help me to unzip a file using PHP . There is 2 different ways to do it.One just execute a commend to unzip the file in the shell using PHP and another one is using library functions
2 1291 posted 16 years ago by fackz
Save this file as a .php somewhere on your webserver - NOT A WEB ACCESSIBLE LOCATION! Edit the lines in the top portion to suit your needs and call the file from bash like this: $> php cpanel-backup.php You can use a cronjob to make this run autom...
1 1273 posted 16 years ago by arnoldb
0 1064 posted 16 years ago by jpsirois
1 1161 posted 16 years ago by jpsirois
3 1384 posted 16 years ago by jpsirois
1 1309 posted 16 years ago by martin_rusev
Split a string containing HTTP response into a array with HTTP headers and a string with HTTP content
1 1486 posted 16 years ago by touv
0 1114 posted 16 years ago by njhamann
Convenience function to set a SimpleXMLElement's attributes quickly.
0 1021 posted 16 years ago by iloveitaly
How to replace sleep(2), for your PHP code. Ideal testing hosting/dns ping.
1 1344 posted 16 years ago by nicolaspar
2 1063 posted 16 years ago by fabi
Pretty straight forward implementation of mysql instantiation using php5 oop. Example usage at the bottom. The database in the example is named 'example_database' and has 1 table, 'newstable'. This table has three columns: 'id,heading,message'. By...
0 908 posted 16 years ago by bakkelun
Using this loop variation you can style differently the first and the last post of a loop, or whatever post you like, as lond as you add a new elseif with the number of the post you desire.
5 1449 posted 16 years ago by crs
1 1293 posted 16 years ago by Shifter
3 1269 posted 16 years ago by Shifter
Takes advantage of the SPL. Much easier and maintainable than the previous revisions. Haven't done any benchmarks yet but I imagine it is much faster. "If you want to omit directories, remove the RecursiveIteratorIterator::SELF_FIRST part."
3 1005 posted 16 years ago by DrewDouglass
All credit for this snippet goes to Roshan, link is given above.
4 1651 posted 16 years ago by DrewDouglass
More info found in the link above, basically, you can replace the $config['base_url'] to the snippet below and you no longer need to set the base url. Useful for making your application more portable.
7 1377 posted 16 years ago by DrewDouglass
Thanks to James Padolsey for sharing this script with everyone on his blog, link above.
0 923 posted 16 years ago by DrewDouglass
All credit for this code goes to the all mighty Fou-Lou of codingforums.com (link given).
0 2318 posted 16 years ago by DrewDouglass
2 1171 posted 16 years ago by blackf0rk
0 762 posted 16 years ago by iloveitaly
0 895 posted 16 years ago by endorfin
2 1082 posted 16 years ago by justinseiter
Need a function to clean your _POST array before inserting into a database? Just pass $_POST to this function.
1 1909 posted 16 years ago by the_dev
It's easy to print out an array that is readable and with only one line of code. This can easily be turned into a nifty function.
1 941 posted 16 years ago by the_dev
1 ... 112 113 114 115 116 ... 147