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 i
string erase(subscript, count)
{
string place="New York";
place erase(0,2)
}
$s = 'Posted On jan 3rd By Some Dude';
echo strstr($s, 'By', true);
This is to remove particular string from a string.
The result will be like this
'Posted On jan 3rd'
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.
The str_ireplace() function does the same job but ignoring the case
like the following
<?php
echo str_ireplace("World","Peter","Hello world!");
?>
output : Hello Peter!
for more example you can see
The str_replace() function replaces some characters with some other characters in a string.
try something like this:
$x->str_replace("_normal","",$x)
Multi replace
$a = array('one','two','three');
$var = "one_1 two_2 three_3";
str_replace($a, '',$var);