This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // String Cleaner – Cleans words you don't want out of strings. | |
| // Step 1 – Define the string and the words yoiu want to remove. | |
| $string = 'this is my silly input how cool is it?'; | |
| $words_to_remove ='silly|my|eggs'; // Seperate words with | this is regular expression. | |
| // Step 2 – shorten the string | |
| $string = substr($string, 0, 23); // This with return the first 23 characters (including spaces) in the string. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="object" class="empty"></div> | |
| <script type="text/javascript" src="http://js.fullondesign.co.uk/jquery-1.3.2.min.js"></script> | |
| <script type="text/javascript"> | |
| //<![CDATA[ | |
| $("#object").removeClass('empty'); | |
| $("#object").addClass('full'); | |
| //]]> | |
| </script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <!– Pull the jQuery base from Google, it has CDN so it should be a little faster. –> | |
| <script type="text/javascript"> | |
| $(document).ready(function() { | |
| $("form input, form input, form textarea").css('color', '#484848'); | |
| $("form .submit").css('color', '#000'); | |
| $("form label").hover(function () { | |
| $("#infobox").html($(this).attr('title')); | |
| }); | |
| $("form input, form input, form textarea").focus(function () { | |
| if($(this).val() == $(this).attr('title')){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <meta name="msapplication-task" content="name=Projects;action-uri=http://www.fullondesign.co.uk/projects/;icon-uri=http://www.fullondesign.co.uk/favicon.ico"/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Coded by Mike Rogers (http://www.fullondesign.co.uk/) 1st October 2010. | |
| function shorten($url, $qr=NULL){ | |
| if(function_exists('curl_init')){ | |
| $ch = curl_init(); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
| curl_setopt($ch, CURLOPT_URL, 'http://goo.gl/api/shorten'); | |
| curl_setopt($ch, CURLOPT_POST, TRUE); | |
| curl_setopt($ch, CURLOPT_POSTFIELDS, 'security_token=null&url='.urlencode($url)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $t->mentions(); | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package hellowrold; | |
| /** | |
| * | |
| * @author Mike | |
| */ | |
| public class Main { | |
| /** | |
| * @param args the command line arguments |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Weather { | |
| public $lat, $long, $weather, $location; | |
| private $weather_data, $location_data; | |
| | |
| public function __construct($lat=0.0, $long=0.0){ | |
| $this->lat = (float) $lat; | |
| $this->long = (float) $long; | |
| } | |
| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function validEmail($email){ | |
| // Check the formatting is correct | |
| if(filter_var($email, FILTER_VALIDATE_EMAIL) === false){ | |
| return FALSE; | |
| } | |
| // Next check the domain is real. | |
| $domain = explode("@", $email, 2); | |
| return checkdnsrr($domain[1]); // returns TRUE/FALSE; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Check if input is alphanumeric (letters and numbers) | |
| ctype_alnum('abcdef1234'); // This returns TRUE | |
| ctype_alnum('£%^&ab2'); // This on the otherhand returns FALSE | |
| // check if input is alpha (letters) | |
| ctype_alpha('dssfsdf'); // returns TRUE | |
| ctype_alpha('12345dssfsdf'); // Returns FALSE | |
| ?> |