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
...