php String Objects Chains like length,forEach,filter,replace,repalcAll much More.... Module

Overview

v1 Str 4 <= php.v

Str("My Somentig String")

php String Objects Chains like length,forEach,filter,replace,repalcAll much More.... ###Job

title ()-> echo("

",");">
Str("hello php")
->title ()->
 echo("

",">);

Output

<h1>Hello Php h1>
forEach(function($chr,$index,$string,$argu){ Str($chr)->firstUpper() ->echo(); //K //O //L //I }); function colors ($color,$index,$array){ if($color == "red"){ return "gray"; }else if($color == "red"){ return "white"; }else { return "black"; } } Str(" My favrouts colores red blue green") ->replaceEach("red|blue|green",colors) ->echo() //My favrouts colores gray white black $strObject = Str("gurjar"); echo $strObject; //[object Str] echo gettype($strObject) // object ">
$str = Str("koli");
$str->forEach(function($chr,$index,$string,$argu){
Str($chr)->firstUpper()
  ->echo();
  //K
  //O
  //L
  //I
});


function colors ($color,$index,$array){
  if($color == "red"){
   return "gray";
  }else  if($color == "red"){
   return "white";
  }else {
  return "black";
  }
}
Str(" My  favrouts colores red blue green")
->replaceEach("red|blue|green",colors)
->echo() //My  favrouts colores gray white  black

$strObject = Str("gurjar");
echo $strObject;  //[object Str]
echo gettype($strObject)  // object

Ref

All Functions

is length call_back() forEach() filter() cslashes() join() slashes() hex2() bin2() chunk() udecode() uencode() chars() c32() crypt() echo() toArray() arrayTo() fromArray() htmlDecode() htmlEncode() htmlspecialEncode() htmlspecialDecode() firstLower() firstUpper() distance() leftTrim() md5() lineBreaks() echoB() aByte() dump() parse_str() print() printB() quotedP_decode() quotedP_encode() quotemeta() rightTrim() sha1() same() soundex() formate() includes() slice() endWith() startWith() replaceAll() replace() replaceLast() replaceEach() findCount() padStart() padEnd() padBoth() repeat() shuffle() split() splitB() wordCount() compare() left() right() both() coll() tags() reverse() toLowerCase() toUpperCase() subCompare() subCount() substring() trim() title() wordwrap() charAt() concat() match() search() cslice()

Interface Str class

class Str {

public function  construct
($string?String)length?Number||is?String


public function call_back
($string?String)? new This

public function indexOf
($find?String)? Number


public function forEach
($call?Function,$arg...?Arguments)? void


public function filter
($call?Function,$arg...?Arguments)? call_back()


public function cslashes
($chr?String)? call_back()


public function join
($join = null;?String)? call_back()


public function slashes
()? call_back()


public function hex2
()? call_back()


public function bin2
()? this


public function chunk
($length?Number,$chunk?String)? call_back()


public function  udecode
()? call_back()


public function   uencode
()? call_back()


public function  chars
($mod?Number)?  (call_back()| Array)

public function  c32
()?  Number


public function  crypt
($salt?String)? call_back()


public function  echo
($offsetA?String,$offsetB?String)? call_back()


public  function toArray  
toArray($separator?String,$limit?PHP_INT_MAX)? Array


public  function arrayTo  
toArray($separator?String,$Array?Array)? call_back()


public  function fromArray  
()? Array


public function htmlDecode  
($Flags?Number,$encoding = null;?Null)?  call_back()


public function  htmlEncode 
($Flags=ENT_QUOTES;?Number,$encoding= null;?Null,$double_encode = true;?Boolean)?  call_back()


public function  htmlspecialEncode 
($Flags=ENT_QUOTES;?Number,$encoding = null;?Null,$double_encode = true;?Boolean)?  call_back()


public function   htmlspecialDecode
($Flags=ENT_QUOTES;?Number)?  call_back()


public function   firstLower
()?  call_back()


public function   firstUpper
()?  call_back()


public function   distance
($string2?String, $insertion_cost = 1;?Number, $replacement_cost = 1;?Number, $deletion_cost = 1;?Number)?  Number


public function    leftTrim
($characters = "\n\r\t\v\x00";?String)?  call_back()


public function    md5
($binary = false;?Boolean)?  call_back()


public function    lineBreaks
($use_xhtml = true;?Boolean)?  call_back()


public function    echoB
($string?String)?  call_back()


public function    aByte
()?  Number


public function    dump
()?  call_back()


public function     parse_str
($result?Global&String)?  call_back()


public function     print
($offsetA = "";?String,$offsetB = "";?String)?  call_back()


public function   printB
($string?String)?  call_back()


public function    quotedP_decode
()?  call_back()

public function    quotedP_encode
()?  call_back()

public function    quotemeta
()?  call_back()

public function    rightTrim
($characters = "\n\r\t\v\x00";?String)?  call_back()



public function    sha1
($binary = false;?Boolean)?  call_back()


public function    same
($string2?String)?  Object()?value|?percent


public function    soundex
()?  call_back()


public function    formate
(...$vales?Arguments)?  call_back()


public function    includes
($find?String)?  Boolean


public function    slice
($start?Number,$end?Number)?  call_back()

public function    endWith
($needle?String)? Boolean


public function    startWith
($needle?String)? Boolean


public function    replaceAll
($search?String,$replace?String||Function,$arg...?Arguments)? call_back()



public function    replace
($search?String,$replace?String||Function,$arg...?Arguments)? call_back()



public function    replaceLast
($search?String,$replace?String||Function,$arg...?Arguments)? call_back()


public function    replaceEach
($search?String,$replace?Function,$arg...?Arguments)? call_back()


public function    findCount
($find?String,!$fun?Function)? (Number|call_back())

public function    padStart
($length =0;?Number,$pad_string?String)? call_back()


public function    padEnd
($length =0;?Number,$pad_string?String)? call_back()


public function    padBoth
($length =0;?Number,$pad_string?String)? call_back()


public function    repeat
($count?Number)? call_back()


public function    shuffle
($count?Number)? call_back()

public function    split
($split?String)? call_back()


public function    splitB
($split?String)? Array


public function    wordCount
($formate =0;?Number,$characters = null;?String)? (Array|Number)


public function   compare
($string2?String)? Number

public function   left
($concat?String)? call_back()


public function   right
($concat?String)? call_back()

public function   both
($concatA = "";?String,$concatB = "";?String)? call_back()

public function   coll
($string2?String)? (Number)


public function   tags
($allowed_tags = null;?Array||String||Null)? call_back()

public function   reverse
()? call_back()


public function   toLowerCase
()? call_back()


public function   toUpperCase
()? call_back()


public function   subCompare
($needle = "";?String, $offset = 0;?Number, $length = 0;?Number, $case_insensitive = false;?Boolean)? Number



public function   subCount
( $needle?String, $offset = 0;?Number, $length = 0;?Number)? Number


public function   substring
( $length?Number)? call_back()

public function   trim
($characters = " \n\r\t\v\x00";?String)? call_back()

public function   title
($separators = " \n\r\t\v\x00";?String)? call_back()


public function   wordwrap
($width = 75;?Number, $break = "\n";?String,$cut_long_words = false;?Boolean)? call_back()


public function   charAt
($index?Number)? call_back()


public function   concat
(...$string?String)? call_back()


public function   match
($match?String, $flags = 0;?Number, $offset = 0;?Number)? Array

public function   matchAll
($match?String, $flags = 0;?Number, $offset = 0;?Number)? Array


public function   search
($search?String)? Number


public function   cslice
($from?String, $to?String)? Number

}

Setup

echo() // Stup //include "your/src//str.php";">
include "Str/str.php";

Str("Stup")->echo() // Stup

//include "your/src//str.php";
You might also like...
Replace Elvis operator (?:) by null coalesce operator (??) when applicable

psalm-elvis-begone A Psalm plugin to replace Elvis operator (?:) by null coalesce operator (??) when applicable Installation: $ composer require --dev

For the super admin, replace WP Admin Bar My Sites menu with an All Sites menu.
For the super admin, replace WP Admin Bar My Sites menu with an All Sites menu.

Super Admin All Sites Menu Also available at https://wordpress.org/plugins/super-admin-all-sites-menu/ Use | Prerequisite | Install | Filters | Demo |

Provides powerful menu editor to replace category based menus in Magento 2

Magento 2 Menu Provides powerful menu editor to replace category based menus in Magento 2. Setup Create new menu in the admin area Content Elements

Easily replace Google Fonts with Bunny Fonts.

=== Replace Google Fonts with Bunny Fonts === Contributors: antonioleutsch Donate link: https://paypal.me/antonioleutsch Tags: google fonts, bunny fon

Replace, concat strings or change number fields permanently using Grid Options
Replace, concat strings or change number fields permanently using Grid Options

It's Pimcore Bundle to replace ,concat strings or change number fields permanently using Grid Options. It will save replaced strings directly in object.

DiscordLookup | Get more out of Discord with Discord Lookup! Snowflake Decoder, Guild List with Stats, Invite Info and more...
DiscordLookup | Get more out of Discord with Discord Lookup! Snowflake Decoder, Guild List with Stats, Invite Info and more...

DiscordLookup Get more out of Discord with Discord Lookup! Snowflake Decoder, Guild List with Stats, Invite Info and more... Website Getting Help Tool

Ratio plugin is a luck plugin. The more lucky you are, the more you win!
Ratio plugin is a luck plugin. The more lucky you are, the more you win!

Ratio Ratio plugin is a luck plugin. The more lucky you are, the more you win Features When you break a block (Cobblestone), it gives/puts you somethi

❄️ Magento 2 Snowflake module allow you to add snow and even more on your site and make winter fun.

❄️ Magento 2 Snowflake module allow you to add snow and even more on your site and make winter fun.

An autoscaling Bloom filter with ultra-low memory footprint for PHP

Ok Bloomer An autoscaling Bloom filter with ultra-low memory footprint for PHP. Ok Bloomer employs a novel layered filtering strategy that allows it t

Releases(v1)
Owner
im__koli
im__koli
Michael Pratt 307 Dec 23, 2022
JSONFinder - a library that can find json values in a mixed text or html documents, can filter and search the json tree, and converts php objects to json without 'ext-json' extension.

JSONFinder - a library that can find json values in a mixed text or html documents, can filter and search the json tree, and converts php objects to json without 'ext-json' extension.

Eboubaker Eboubaker 2 Jul 31, 2022
Much improved replacement for Zend_Cache_Backend_File - works great with Magento!

Cm_Cache_Backend_File The stock Zend_Cache_Backend_File backend has extremely poor performance for cleaning by tags making it become unusable as the n

Colin Mollenhour 146 Aug 22, 2022
Creating data transfer objects with the power of php objects. No php attributes, no reflection api, and no other under the hook work.

Super Simple DTO Creating data transfer objects with the power of php objects. No php attributes, no reflection api, and no other under the hook work.

Mohammed Manssour 8 Jun 8, 2023
PHP package to make your objects strict and throw exception when you try to access or set some undefined property in your objects.

?? Yell PHP package to make your objects strict and throw exception when you try to access or set some undefined property in your objects. Requirement

Zeeshan Ahmad 20 Dec 8, 2018
Deeper is a easy way to compare if 2 objects is equal based on values in these objects. This library is heavily inspired in Golang's reflect.DeepEqual().

Deeper Deeper is a easy way to compare if 2 objects is equal based on values in these objects. This library is heavily inspired in Golang's reflect.De

Joubert RedRat 4 Feb 12, 2022
QuidPHP/Main is a PHP library that provides a set of base objects and collections that can be extended to build something more specific.

QuidPHP/Main is a PHP library that provides a set of base objects and collections that can be extended to build something more specific. It is part of the QuidPHP package and can also be used standalone.

QuidPHP 4 Jul 2, 2022
PHP library with basic objects and more for working with Facebook/Metas Conversions API

PHP library with basic objects and more for working with Facebook/Metas Conversions API Installation The easiest way to install this library is by ins

null 5 Dec 5, 2022
This is an experiment to export all RFCs from the PHP wiki into Git, including the change history for each RFC (along with the date and author of each change). This is not meant to replace the wiki.

PHP Requests for Comments (RFCs) About This repository is an experiment to export all RFCs from the PHP wiki into Git, including the change history fo

Ben Ramsey 34 Jun 20, 2022
A super simple, clean and pretty error handler that replace the default error handler of PHP. You need only include this file!

php-custom-error-handler A super simple, clean and pretty error handler that replace the default error handler of PHP. You need just include only this

null 6 Nov 7, 2022