Welcome To Snipplr
Everyone's Recent PHP Snippets Tagged php
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
This is what I wanted:\r\nI had a structure like this:\r\n-Artist\r\n --Peter Miller\r\n ---Pictures\r\n ---Press\r\n ---Videos\r\n\r\nand wanted to have the sub-sub-Menu when located on the \"Peter Miller\"-Page. \r\nSo that on \"Peter...
0
654
posted 14 years ago by zartgesotten
A simple wrapper class for MySql around PDO. Also an example on how to use this wrapper for SQLite.
1
657
posted 14 years ago by Knarf
Working on creating a 'days ago' script. I know some already exist, but I just want to know how to do it myself. I'm also incorporating leap year functionality and some utility functions that could be used on other projects.
2
1025
posted 14 years ago by alvincrespo
Originally written by Jason Lengstorf, rewritten by Drew Douglass, packaged into the EnnuiCMS (link above), can be used as standalone class.
Be sure to change or define your constants for PAGE_OBJ_WIDTH and PAGE_OBJ_HEIGHT when using the YouTube m...
1
786
posted 14 years ago by DrewDouglass
Substitute new_ placeholder in the second line with your new prefix. Run it: http://www.yoursite.com/rename.php and wait until it responds with an OK, usually after a couple of seconds. Delete the rename.php script. Edit the configuration.php file...
0
925
posted 14 years ago by beneberle
I\'ve added an additional case to handle videos linked from a user\'s channel.
2
1185
posted 14 years ago by Jamie
This code adds the specified library to the header in WordPress unless you are in the admin section.
2
747
posted 14 years ago by jonkemp
When retrieving table rows with PHP and prepared statements, you must use a method called bind_result() and pass in a variable name for each column that is being returned from the database. For example, if you are selecting three columns (say, id, ti...
3
1174
posted 14 years ago by Nettuts
The current time, converted from UNIX timestamp to use in MySQL DATETIME
0
974
posted 14 years ago by koko
Simple piece of PHP to get the contents of a specified tag from an XML file and return it
3
1568
posted 14 years ago by ollie101
Send SMS via www.smsmatrix.com SMS Gateway using PHP
See more examples at <A HREF="http:/www.smsmatrix.com">SMS/Voice/TTS Gateway</a>
0
735
posted 14 years ago by smsmatrix
I used to program in classic ASP and would sometimes check if a certain word or letter would be in a string with instr.
if instr(haystack, needle)>0 then
DO SOMETHING
end if
If the needle starts on the first position of the haystack, instr...
0
706
posted 14 years ago by seloh77
Here's a handy (relatively undocumented) tip. PHP supports the following method of assigning strings (borrowed from Perl)
0
623
posted 14 years ago by Snaver
Save the source provided to /app/view/helpers/timezone_select.php
To use the below helper, just put this code into your view:
echo $timezoneSelect->select('timezone', 'Please select your timezone', 'Europe/London');
Also, don't forget to...
1
786
posted 14 years ago by richt
ÐœÐµÐ½Ñ Ñ‡Ð°Ñто Ñпрашивают как Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ CodeIgniter получить доÑтуп к $_GET параметрам. Ð”Ð»Ñ Ñтого нужна вÑего лишь одна Ñтрочка кода в контроллере:...
1
770
posted 14 years ago by stancox
A source to help you interpreting URLs in plain text as a HTML link. It's an improvement of what was proposed here : http://snipplr.com/view/2371/regex-regular-expression-to-match-a-url/
3
1167
posted 14 years ago by keevkilla
If your WordPress blog is outdated even by a few days and there's a security hole in your old version you could be seriously compromised without even knowing it. Trust me. This has happened to two of my clients and the fix is not easy. Usually, once...
0
785
posted 14 years ago by josephknight
Check to see if HTTP POST variable exists before doing something with it.
0
829
posted 14 years ago by jonkemp