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 256 views
1 answer 210 views
2 answers 321 views
1 answer 123 views
123 views asked Aug 20, 2023 by avibootz
1 answer 116 views
1 answer 116 views
1 answer 107 views
107 views asked Aug 18, 2023 by avibootz
...