How to trim leading and trailing asterisk (*) from a string in PHP

1 Answer

0 votes
$s = "*******c# c++ c java php****";

$s = trim($s, '*');

echo $s;



/*
run:

c# c++ c java php  

*/

 



answered Jul 11, 2020 by avibootz

Related questions

1 answer 182 views
1 answer 176 views
1 answer 209 views
3 answers 433 views
1 answer 179 views
2 answers 104 views
...