jaman
answered Aug 17 '21 00:00
$newstring=str_replace(".csv","",'stock.csv');
echo $newstring;
output : stock
above code replace .csv from the stock.csv and return stock only
str_replace() is function in PHP used for the replace the matching portion of the string to another string , from given string
str_replace(string to find,replace part,main string)
so suppose "hello world" is main string , if you want to replace the "world" string with string "global" then
str_replace("hello","global","Hello world")