PHP Classes

PHP String class: Convert and replace text strings

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 174 This week: 1All time: 8,782 This week: 571Up
Version License PHP version Categories
php-string-class 1.0.1MIT/X Consortium ...5.4PHP 5, Text processing
Description 

Author

This class can convert and replace text strings.

It provides a few functions that can perform several operations with text strings.

Currently it replace a text string with given replacement words, clean a string from undesired characters, and convert the case of the strings.

Picture of Muhammad Umer Farooq
Name: Muhammad Umer Farooq is available for providing paid consulting. Contact Muhammad Umer Farooq .
Classes: 52 packages by
Country: Pakistan Pakistan
Age: 22
All time rank: 84611 in Pakistan Pakistan
Week rank: 103 Up4 in Pakistan Pakistan Up
Innovation award
Innovation award
Nominee: 6x

Example

<?php

require_once 'classes/String.php';
$str = new Strings();

$string = 'I love CPP';

$hack = "<script>alert('working');</script>";

$replace = $str->ReplaceWords(
[
   
'replacing_word' => 'CPP',
   
'replacing_with' => 'php',
   
'text' => $string,
]);
$lower_case = $str->StringConversion(
[
   
'type' => 'lowercase',
   
'text' => $replace,
]);
$upper_case = $str->StringConversion(
[
   
'type' => 'uppercase',
   
'text' => $replace,
]);
$camel_case = $str->StringConversion(
[
   
'type' => 'camelcase',
   
'text' => $replace,
]);

$clean_secured = $str->CleanInput(
[
   
'type' => 'secured',
   
'input' => $hack,
]);
$clean_root = $str->CleanInput(
[
   
'type' => 'root',
   
'input' => $hack,
]);

echo
$replace;
echo
'<br>';
echo
$lower_case;
echo
'<br>';
echo
$upper_case;
echo
'<br>';
echo
$camel_case;
echo
'<br>';
echo
$clean_secured;
echo
'<br>';
echo
$clean_root;


Details

PHP String Class

This package can Clean inputs,string conversion,string replacement.


  Files folder image Files  
File Role Description
Files folder imageclasses (1 file)
Accessible without login Plain text file example.php Example Example script
Accessible without login Plain text file readme.md Doc. Documentation

  Files folder image Files  /  classes  
File Role Description
  Plain text file String.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:174
This week:1
All time:8,782
This week:571Up