+2 votes
250 views
in Programming by (440 points)
retagged by

I have an array in which links and titles  are stored like this :

$array = array();

foreach($books as $img) 
{

$array[$title] = $src;

}

Now in title some unwanted characters are coming i want to remove  replace those characters from array.Thanks for help!

1 Answer

+1 vote
by (1.3k points)

There is a simple function for the same see:

lets say you want to remove asdf from a string $title  which is

$title = “Appleasdf ” ;

str_replace('asdf','', $title)


Here we have replaced asdf from blank so now your string is

$title = “Apple”;

I hope you would use this according to your need.

Not a Member yet?

Ask to Folks Login

My Account

Your feedback is highly appreciated