Delete particular word from string
php, string
Solution
Php str_replace.
str_replace('_normal', '', $var)
What this does is to replace '_normal' with '' (nothing) in the variable $var. Or take a look at preg_replace if you need the power of regular expressions.
Problem
I'm extracting twitter user's profile image through JSON. For this my code is: ``` $x->profile_image_url ``` that returns the url of the profile image. The format of the url may be `"..xyz_normal.jpg"` or `"..xyz_normal.png"` or `"..xyz_normal.jpeg"` or `"..xyz_normal.gif"` etc. Now I want to delete the "_normal" part from every url that I receive. How can I achieve this in php? I'm tired of trying it. Please help.