function makemeslug($data=””){ if($data){ $data = trim(strtolower($data)); $search = array(‘/’,’\\’,’:’,’;’,’!’,’@’,’#’,’$’,’%’,’^’,’*’,'(‘,’)’,’_’,’+’,’=’,’|’,'{‘,’}’,'[‘,’]’,'”‘,”‘”,'<‘,’>’,’,’,’?’,’~’,’`’,’&’,’.’); $ds = str_replace($search,” “,$data); $ds2 = preg_replace(‘/\s+/’,’ ‘,$ds); $slug = trim($ds2); $slug = str_replace(” “,”-“,$slug); return …
Read MorePHP
Php-How to make slug in php
## make slug using this function. Like: stackofcodes.in/2016/01/10/how-to-search-data-from-table-in-php/ function makeslug($str) { return preg_replace(“/[^0-9a-zA-Z]+/”, “-“, $str); } $tog = how_can i make slug. $slug …
Read Morehow to fetch field value from table in php
## How to fetch a field value from database in php $r = mysql_query(“select field_name from table_name”); $value =@mysql_result($r,0,”field_name);
Read Moresend mail from localhost in php
<?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 Moresend 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 More