How to split the last part of a string in PHP

1 Answer

0 votes
$str = "c# c java c++ python php";

$lastpart = substr($str, strripos($str,' ') + 1);
        
echo $lastpart;





/*
run:

php

*/

 



answered Aug 19, 2023 by avibootz

Related questions

1 answer 353 views
1 answer 312 views
2 answers 447 views
1 answer 222 views
222 views asked Aug 20, 2023 by avibootz
1 answer 196 views
1 answer 210 views
1 answer 194 views
194 views asked Aug 18, 2023 by avibootz
...