How to remove a specific character from a string in PHP

1 Answer

0 votes
$str = "PHP Programming";

/* str_replace(
    array|string $search,
    array|string $replace,
    string|array $subject,
    int &$count = null
): string|array */

$str = str_replace("P", "", $str);

echo $str;




/*
run:

H rogramming

*/

 



answered Dec 6, 2022 by avibootz

Related questions

1 answer 264 views
1 answer 236 views
1 answer 336 views
1 answer 237 views
1 answer 214 views
1 answer 233 views
...