v1_countTheEntities

The Contact Form 7 - Infusionsoft Add-on v1 countTheEntities function.

Description

v1_countTheEntities( $m ); 

Parameters (1)

0. $m
The m.

Usage

  1. if ( !function_exists( 'v1_countTheEntities' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7-infusionsoft-add-on/src/xmlrpc-3.0/demo/server/server.php'; 
  3.  
  4. // The m. 
  5. $m = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = v1_countTheEntities($m); 
  9.  

Defined (1)

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

/src/xmlrpc-3.0/demo/server/server.php  
  1. function v1_countTheEntities($m) 
  2. $sno=$m->getParam(0); 
  3. $str=$sno->scalarval(); 
  4. $gt=0; $lt=0; $ap=0; $qu=0; $amp=0; 
  5. for($i=0; $i<strlen($str); $i++) 
  6. $c=substr($str, $i, 1); 
  7. switch($c) 
  8. case ">": 
  9. $gt++; 
  10. break; 
  11. case "<": 
  12. $lt++; 
  13. break; 
  14. case "\"": 
  15. $qu++; 
  16. break; 
  17. case "'": 
  18. $ap++; 
  19. break; 
  20. case "&": 
  21. $amp++; 
  22. break; 
  23. default: 
  24. break; 
  25. return new xmlrpcresp(new xmlrpcval(array( 
  26. "ctLeftAngleBrackets" => new xmlrpcval($lt, "int"),  
  27. "ctRightAngleBrackets" => new xmlrpcval($gt, "int"),  
  28. "ctAmpersands" => new xmlrpcval($amp, "int"),  
  29. "ctApostrophes" => new xmlrpcval($ap, "int"),  
  30. "ctQuotes" => new xmlrpcval($qu, "int")),  
  31. "struct" 
  32. ));