<< < 1 2 3   ∑:64  Sort:Rank

Facebook Comments for WordPress
Useful PHP Code Snippets for Developers - Facebook Comments for WordPress &lt;div id="fb-root">&lt;/div> &lt;script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en...
2015-07-01, 1489🔥, 0💬

The Real Way To Check Uploaded File Type
Useful PHP Code Snippets for Developers - The Real Way To Check Uploaded File Type &lt;?php // Here we specify all the type of files we want to accept $extension = array("application/pdf", "image/jpeg", "image/png", "image/gif"); if(isset($_POST['submit'])){ exec("file -i ".$_FILES['inputName'][...
2015-07-01, 1873🔥, 0💬

WordPress – Scheduling Posts for RSS
Useful PHP Code Snippets for Developers - WordPress – Scheduling Posts for RSS function publish_later_on_feed($where) { global $wpdb; if(is_feed()) { // timestamp in WP-format $now = gmdate('Y-m-d H:i:s'); // value for wait; + device $wait = '5'; // integer // http://dev.mysql.com/doc/refma n/5.0/...
2015-06-19, 1290🔥, 0💬

Validate email Address
Useful PHP Code Snippets for Developers - Validate email Address function is_valid_email($email, $test_mx = false) { if(eregi("^([_a-z0-9-]+)(\.[_a -z0-9-]+)*@([a-z0-9-]+)(\.[a-z 0-9-]+)*(\.[a-z]{2,4})$",$email)) if($test_mx) { list($username, $domain) = split("@", $email); return getmxrr($domain, $m...
2015-06-19, 1325🔥, 0💬

How to generate an authentication code in PHP ?
Useful PHP Code Snippets for Developers - How to generate an authentication code in PHP ? <?php # This particular code will generate a random string # that is 25 charicters long 25 comes from the number # that is in the for loop $string = "abcdefghijklmnopqrstuvwxyz012 3456789";for($i=0;$i
2015-06-19, 1348🔥, 0💬

Unzip a Zip File
Useful PHP Code Snippets for Developers - Unzip a Zip File <?php function unzip($location,$newLocation){ if(exec("unzip $location",$arr)){ mkdir($newLocation); for($i = 1;$i //Use the code as following:
2015-06-19, 1287🔥, 0💬

username, password and date validation with php
Useful PHP Code Snippets for Developers - username, password and date validation with php
2015-06-19, 1230🔥, 0💬

url, email and ip validation with php
Useful PHP Code Snippets for Developers - url, email and ip validation with php
2015-06-19, 1085🔥, 0💬

How to short URL Function with PHP ?
Useful PHP Code Snippets for Developers - How to short URL Function with PHP 45){ $length = $length - 30; $first = substr($url, 0, -$length); $last = substr($url, -15); $new = $first."[ ... ]".$last; return $new; }else{ return $url; } } ?> // USAGE <?php $longurl= "http://www.google.com/search? q=...
2015-06-19, 2551🔥, 0💬

How to get short urls for Twitter with PHP
Useful PHP Code Snippets for Developers - How to get short urls for Twitter with PHP
2015-06-19, 969🔥, 0💬

How to get users’ IP Address with PHP
Useful PHP Code Snippets for Developers - How to get users’ IP Address with PHP function getRealIpAddr() { if (!empty($_SERVER['HTTP_CLIENT_ IP']))//check ip from share internet { $ip=$_SERVER['HTTP_CLIENT_IP'] ;} elseif (!empty($_SERVER['HTTP_X_FORWA RDED_FOR']))//to check ip is pass from proxy ...
2015-06-19, 1105🔥, 0💬

How to get Country By IP Address in PHP
Useful PHP Code Snippets for Developers - How to get Country By IP Address in PHP '', 'city'=>''); if(filter_var($client, FILTER_VALIDATE_IP)){ $ip = $client; }elseif(filter_var($forward, FILTER_VALIDATE_IP)){ $ip = $forward; }else{ $ip = $remote; } $ip_data = @json_decode (file_get_contents("http:/...
2015-06-19, 1346🔥, 0💬

How to use PHPMailer to Send HTML Emails With Images
Useful PHP Code Snippets for Developers - Using PHPMailer To Send HTML Emails With Images IsSMTP(); $mail->Host = "smtp1.example.com;smtp2.examp le.com";$mail->SMTPAuth = true; $mail->Username = 'smtpusername'; $mail->Password = 'smtppassword'; $mail->From="mailer@example.co m";$mail->FromName="My s...
2015-06-19, 1521🔥, 0💬

MD5 Hash Function in PHP
How to calculate the MD5 hash of a string in PHP? You can use the following md5() function to calculate the MD5 hash of a string using the MD5 Message-Digest Algorithm. string md5 ( string $str [, bool $raw_output = false ] ) str - The input string. raw_output - If TRUE, then the md5 digest is inste...
2015-05-30, 1068🔥, 0💬

Online Test of Regular Expression Patterns
Where can I do Regular Expression patterns tests online? You can go to http://regex.fyicenter.com/PHP _Regular_Expression_Pattern_Ma tch.php. This online testing page is provided by FYIcenter.com to help you learn and test regular expression match patterns, using the PHP preg_match_all(pattern, subje...
2015-05-22, 1013🔥, 0💬

php json array problems
I am creating a json array in PHP like this (it's inside a class): $STH = $DBH->query("SELECT ID,title,content FROM table WHERE ID= '".$ID."' "); $querycount = $STH->rowCount(); if($querycount!=0): $STH->setFetchMode(PDO::FETCH_ OBJ);while( $row = $STH->fetch()) : $thread[$row->ID]['title'] = $row->...
2015-05-21, 1250🔥, 0💬

<< < 1 2 3   ∑:64  Sort:Rank