To replace words in a string in php
<p>I have a query result like written bellow</p>

<pre><code>(383,'_transient_dash_aa95765b5cc111c56d5993d476b1c2f0','&lt;div class="rss-widget"&gt;&lt;ul&gt;&lt;li&gt;&lt;a class='rsswidget' href='http://ma.tt/2013/02/new-yahoo-2/' title='Marissa Mayer announces the new Yahoo hompage, on a WordPress-powered blog. [&amp;hellip;]'&gt;Matt: New Yahoo&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class='rsswidget' href='http://ma.tt/2013/02/100-gpl/' title='Creative Market just announced that all of their WordPress Themes are now 100% GPL, meaning to list in their marketplace and reach their users your theme must provide users with the same freedoms that WordPress itself does. They have some great themes already. This is fantastic news and I’m very proud of their team for taking this bold step, and as promised  [&amp;hellip;]'&gt;Matt: 100% GPL&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class='rsswidget' href='http://wordpress.tv/2013/02/20/leslie-hancock-developing-a-distinctive-online-voice/' title=' [&amp;hellip;]'&gt;WordPress.tv: Leslie Hancock: Developing a Distinctive Online Voice&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class='rsswidget' href='http://wordpress.tv/2013/02/20/scott-basgaard-help-yourself-by-helping-others/' title=' [&amp;hellip;]'&gt;WordPress.tv: Scott Basgaard: Help Yourself by Helping Others&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a class='rsswidget' href='http://feedproxy.google.com/~r/weblogtoolscollection/UXMP/~3/3tj7MIPbhOc/' title='The new default theme for WordPress 3.6, titled Twenty Thirteen, is making progress. This year’s default theme is overseen by Matt Mullenweg, and built by Joen Asmussen, Konstantin Obenland, and Lance Willett. The goal for Twenty Thirteen is to offer “a focus on blogging, and great support for post formats (which are getting attention on the backend in 3.6 a [&amp;hellip;]'&gt;Weblog Tools Collection: Twenty Thirteen Theme in Progress&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;','no'),(384,'_transient_timeout_feed_57bc725ad6568758915363af670fd8bc','1361468732','no')
</code></pre>

<p>Now in the above string i got </p>

<pre><code>class='rsswidget' , href='http://ma.tt/2013/02/new-yahoo-2/' and title='Marissa Mayer announces the new Yahoo hompage, on a WordPress-powered blog. [&amp;hellip;]'
</code></pre>

<p>I want replace those string to </p>

<pre><code>   class='rsswidget' to class="rsswidget"
href='http://ma.tt/2013/02/new-yahoo-2/' to href="http://ma.tt/2013/02/new-yahoo-2/"
title='Marissa Mayer announces the new Yahoo hompage, on a WordPress-powered blog. [&amp;hellip;]' to title="Marissa Mayer announces the new Yahoo hompage, on a WordPress-powered blog. [&amp;hellip;]"
</code></pre>

<p>i tried with the bellow written code.</p>

<pre><code>    if(strstr($sql, "href='")){
        $sql = str_replace("href='*'", 'href="*"', $sql);

$data = $sql;
fwrite($handle, $data);
    }
</code></pre>

<p>Is there any wrong with my code or any other way to change the words in the string. Please help me.</p>
