< 1 2   Sort: Rank

url, email and ip validation with php
Useful PHP Code Snippets for Developers - url, email and ip validation with php
2015-06-19, 492👍, 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, 465👍, 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, 417👍, 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, 431👍, 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, 533👍, 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, 568👍, 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, 469👍, 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, subjec...
2015-05-22, 396👍, 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, 492👍, 0💬

< 1 2   Sort: Rank