How to strip off the first 10 characters from a string in PHP

1 Answer

0 votes
$string = "PHP Python C C++";

if (strlen($string) > 10) {
    $string = substr($string, 10);
}

echo $string;



/*
run:

 C C++

*/

 



answered Dec 17, 2023 by avibootz

Related questions

3 answers 274 views
2 answers 254 views
1 answer 192 views
2 answers 271 views
...