<?php error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_STRICT); set_include_path(“.” . PATH_SEPARATOR . ($UserDir = dirname($_SERVER[‘DOCUMENT_ROOT’])) . “/pear/php” . PATH_SEPARATOR . get_include_path()); require_once “Mail.php”; $host …
Read MoreCodeIgniter
send mail from localhost
USED LINK:: http://stackoverflow.com/questions/15965376/how-to-configure-xampp-to-send-mail-from-localhost Modify this files: 1. MODIFY php.ini 2. modify sendmail.ini
Read MoreGet url Segments in php
## Get Url Segments from Url in php $uri_path = parse_url($_SERVER[‘REQUEST_URI’], PHP_URL_PATH); $uri_segments = explode(‘/’, $uri_path);
Read MoreAdd/Modify Data in Existing Array
## Add/Modify Data in Existing Array $msg= array( [0]=array( ‘id’=2 ‘name’=som ) [1]=array( ‘id’=3 ‘name’=mon ) ) if($msg){ foreach ($msg as &$val) { …
Read MoreJoin table using function
// Join variables are assigned here:: $slct = “mg.*”; $from = $prev.”msg as mg JOIN mber as m ON m.ud = mg.fd”; $cond = “mg.td …
Read MoreShow only 100 chars from huge text
<?php if($product_details[‘description’] != “”) { echo substr(strip_tags(html_entity_decode($product_details[‘description’])), 0, strrpos(substr(strip_tags(html_entity_decode($product_details[‘description’])), 0, 100), ‘ ‘)) . …
Read MoreReload Parent window From Child Window
Reload Parent window from pop-up child window:: window.opener.location.reload(false) https://developer.mozilla.org/en-US/docs/Web/API/Window
Read MoreGet all months name in php
$months = array(); $currentMonth = 0; //(int)date(‘m’); for ($x = $currentMonth; $x < $currentMonth + 12; $x++) …
Read MoreCheck Email Validation using JavaScript in php
function validateEmail(email) { var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; return emailReg.test(email); }
Read More