nxs_spinRecursion

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

Description

nxs_spinRecursion( &$txt, $startCh ); 

Parameters (2)

0. $txt
The txt.
1. $startch
The startch.

Usage

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

Defined (1)

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

/inc/nxs_functions_adv.php  
  1. if (!function_exists("nxs_spinRecursion")) { function nxs_spinRecursion(&$txt, $startCh) { global $nxs_spin_lCh, $nxs_spin_rCh, $nxs_spin_splCh; $startPos = $startCh; 
  2. while ($startCh++ < strlen($txt)) { 
  3. if (substr($txt, $startCh, strlen($nxs_spin_lCh)) == $nxs_spin_lCh) $txt = nxs_spinRecursion($txt, $startCh); 
  4. elseif (substr($txt, $startCh, strlen($nxs_spin_rCh)) == $nxs_spin_rCh) { 
  5. $tmpTxt = substr($txt, $startPos+strlen($nxs_spin_lCh), ($startCh - $startPos)-strlen($nxs_spin_rCh)); 
  6. $toRepl = nxs_spinReplace($tmpTxt); $txt = str_replace($nxs_spin_lCh.$tmpTxt.$nxs_spin_rCh, $toRepl, $txt); 
  7. } return $txt; 
  8. }}