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 242 views
1 answer 200 views
2 answers 305 views
1 answer 112 views
112 views asked Aug 20, 2023 by avibootz
1 answer 108 views
1 answer 106 views
1 answer 99 views
...