النصوص

النصوص $lezaz->string

تتضمن لزاز إضافة البحث داخل النصوص لتوفير الوقت والجهد , وهي دوال بسيطه يمكن من خلالها البحث عن أي نص بكل سهوله

» $lezaz->string

after

$lezaz->string->after($strthis, $inthat);

$strthis='abscdefsghijklmnopqrstuvswxyz';
$find= $lezaz->string->after('s',$strthis );
echo "result search for 's' after $strthis is : \n $find";

/*
result search for 's' after abscdefsghijklmnopqrstuvswxyz is : 
 cdefsghijklmnopqrstuvswxyz
*/
after_last

$lezaz->string->after_last($strthis, $inthat);

$strthis='abscdefsghijklmnopqrstuvswxyz';
$find= $lezaz->string->after_last('s',$strthis );
echo "result search for 's' after_last $strthis is : \n $find";

/*
result search for 's' after_last abscdefsghijklmnopqrstuvswxyz is : 
 wxyz
*/

before

$lezaz->string->before($strthis, $inthat);

$strthis='abscdefsghijklmnopqrstuvswxyz';
$find= $lezaz->string->before('s',$strthis );
echo "result search for 's' before $strthis is : \n $find";

/*
result search for 's' after_last abscdefsghijklmnopqrstuvswxyz is : 
 ab
*/

after_last

$lezaz->string->before_last($strthis, $inthat);

$strthis='abscdefsghijklmnopqrstuvswxyz';
$find= $lezaz->string->before_last('s',$strthis );
echo "result search for 's' before_last $strthis is : \n $find";

/*
result search for 's' before_last abscdefsghijklmnopqrstuvswxyz is : 
 abscdefsghijklmnopqrstuv
*/

between

$lezaz->string->between($strthis, $that, $inthat);

$strthis='abscdefsghijklmnopqrstuvswxyz';
$find= $lezaz->string->between('s','s',$strthis );
echo "result search for between 's' and 's' in $strthis is : \n $find";

/*
result search for between 's' and 's' in abscdefsghijklmnopqrstuvswxyz is : 
 cdef
*/

between_last

$lezaz->string->between_last($strthis, $that, $inthat);

$strthis='abscdefsghijklmnopqrstuvswxyz';
$find= $lezaz->string->between_last('s','s',$strthis );
echo "result search for between_last 's' and 's' in $strthis is : \n $find";

/*
result search for between_last 's' and 's' in abscdefsghijklmnopqrstuvswxyz is : 
 tuv
*/