How to remove chars from an integer value?


I want to remove arj from string and output  = 2006

example: arj2006

Asked 28 Sep, 17 at 03:35 AM

Rishu Singh
Php String

Answer

try this:
$str = "arj2006";

$str = preg_replace('/[^0-9.]+/', '', $str);
echo $str;

like