Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $string = $text;
- $returnString = '';
- $pattern = '/((?:\\u[dA-F]{4}){2})/i';
- preg_match_all ( $pattern , $string , $mtchs);
- $patternSplit = '/((?:\\u[dA-F]{4}){2})(\\u)/i';
- $formattedData = preg_replace($patternSplit, ' $1 $2', $string);
- $wordArray = explode(" ", $formattedData);
- if(count($wordArray) > 0)
- {
- foreach($wordArray as $wa)
- {
- $this->db->where("emoticon_code",$wa);
- $returnCode = $this->db->get("emoticon");
- if($returnCode->num_rows()>0)
- {
- $returnArray = $returnCode->result_array();
- $retImage = base_url(). 'uploads/emoticon/'. $returnArray[0]['emoticon_image'];
- if($from == 'admin')
- $wa = "<img src='$retImage' width='20px' height='20px'/>";
- else
- $wa = $retImage;
- }
- $returnString .= " ".$wa;
- }
- }
- else
- {
- $returnString = '';
- }
- return $returnString;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement