nxs_mbConvertCaseUTF8var

The NextScripts: Social Networks Auto-Poster nxs mbConvertCaseUTF8var function.

Description

nxs_mbConvertCaseUTF8var( $s ); 

Parameters (1)

0. $s
The s.

Usage

  1. if ( !function_exists( 'nxs_mbConvertCaseUTF8var' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextscripts-social-networks-auto-poster/inc/nxs_functions_adv.php'; 
  3.  
  4. // The s. 
  5. $s = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = nxs_mbConvertCaseUTF8var($s); 
  9.  

Defined (1)

The function is defined in the following location(s).

/inc/nxs_functions_adv.php  
  1. if (!function_exists("nxs_mbConvertCaseUTF8var")) { function nxs_mbConvertCaseUTF8var($s) { $arr = preg_split("//u", $s, -1, PREG_SPLIT_NO_EMPTY); $result = ""; $mode = false;  
  2. foreach ($arr as $char) { $res = preg_match('/\\p{Mn}|\\p{Me}|\\p{Cf}|\\p{Lm}|\\p{Sk}|\\p{Lu}|\\p{Ll}|\\p{Lt}|\\p{Sk}|\\p{Cs}/u', $char) == 1;  
  3. if ($mode) { if (!$res)$mode = false; } elseif ($res) { $mode = true; $char = mb_convert_case($char, MB_CASE_TITLE, "UTF-8"); } $result .= $char;  
  4. } return $result;  
  5. }}