Complete BLoC with Clean Architecture (group chat) Discount !! E-commerce App With Backend Source Code Video and Voice Chatting App Firebase Chatting App Source Code Complete Gym App BLoC State Management Source Code Complete Study App Buy Ticket Booking App Source Code Buy Travel App With Backend Source Code Complete Chat App Udemy Course Special Offer Discount !! Online Learning Course App (BLoC) Online Learning Course App (Riverpod) Online Learning Course App (Getx) Discount !! Shopping App (Provider) Cool Flutter Game Flutter Nodejs Chat App Flutter Nodejs Api And Firebase Chat App Riverpod Task Management App
It's your best friend when you have a string, and wanna replace part of the string with other things or other strings or anything.
It takes three arguments
str_replace("word to look for", "word to replace with", "original string")
$str = "hello world"; $newStr = str_replace("world", "dbestech", $str); print($newStr);
This would print
Another good exmple when you do url manupulatation for seo in PHP or Laravel. You wanna replace the white space with "-". So str_replace() comes to rescue you.
$url = "the best backend framework"; $newUrl = str_replace(" ", "-", $url); print($newUrl);
This would print somethng like below