I am trying to get add block after 1st image, so far i have mange to get it after 1st paragraph .
Here is my code
$HPSB =' <img src="**/facebook131update1.png" border="0" alt=""/>
<p>
If you're a Facebook for iOS user and you checked the Updates tab in your App Store application recently, then you probably noticed the new Facebook version 13.1 update that was waiting there for you to install.
</p>
Facebook version 13.1 doesn't go very specific into what's new apart from "Bug Fixes," but according to Facebook's detailed ';
function callback_func($matches)
{
static $count = 0;
$ret = $matches[1];
if (++$count == 1)
$ret .= '<div style="float:left;margin:10px 10px 10px 0;">
<script type="text/javascript"><!--
google_ad_client = "ca-pub-***";
/* iMac 336*280 */
google_ad_slot = "***";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="//pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>';
return $ret;
}
$content = preg_replace_callback('#(<p>.*?</p>)#', 'callback_func', $HPSB);
How can get it, Please help
EDIT
$HPSB =
<p style="text-align: center;">
<img class="size-large wp-image-566952 aligncenter" title="Here’s more evidence Apples ‘iPhone 6' event will be on Sept. 9" src="http://abcaa.com/wp-content/uploads/2014/08/btsendate.jpg" alt="Here’s more evidence Apples ‘iPhone 6' event will be on Sept. 9"/>
</a>
</p>
<p>Weve found an interesting piece of information that further backs up the recent report that Apple is planning to introduce the iPhone 6 at a special media event on Tuesday, Sept 9.</p>
<p>Apple’s Back to School promotion will also stop on that same date. </p>
<p>So it definitely makes sense that Apple doesnt want students being able to take advantage of the promotion when buying a new device.</p>
<p>With this years promotion, college students can receive a $100 Apple Store gift card with the purchase of a Mac or a $50 store gift card when they purchase an iPad or iPhone. Students can also take advantage of Apples educational pricing.</p>
<p>Along with college students, the promotion is available for parents of a student or a faculty or staff member from any grade level.</p>
<p>The next-generation handset is expected to be unveiled in both a 4.7-inch and 5.5-inch version. It should also feature a faster A8 processor, a better camera, and other improvements.</p>
<p>For other recent news, see: Read the entire Tom Hanks interview with the App Store on Twitter, all about apps.</p>
<br/>