Horje
remove word from string php Code Example
remove word from string php
<?php
// IF ONLY CHARACTER IN STRINGS
$str = "Hello PHP";
echo str_replace("PHP","",$str); // its remove PHP From string
//Output = Hello;

// IF NUMARIC OR CHARACTERS IN STRING AND YOU NEED ONLY STRING
$strInt = "124Peter56";
echo $words = preg_replace('/[0-9]+/', '', $strInt); // it remove integer from string
// Output = Peter;

// IF NUMARIC OR CHARACTERS IN STRING AND YOU NEED ONLY INTEGERS
$strInt = "124Peter56";
echo $res = preg_replace("/[^0-9]/", "", $strInt ); // It Remove all string 
// Output = 12456
?>




Php

Related
how to increase request timeout in laravel Code Example how to increase request timeout in laravel Code Example
php domdocument get elements one by one Code Example php domdocument get elements one by one Code Example
correction of controller Code Example correction of controller Code Example
php to python converter online free Code Example php to python converter online free Code Example
hook into admin add order item / product on add/submit Code Example hook into admin add order item / product on add/submit Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8