PHP Strip Tags with allowed tags

I am trying to learn a little more about php strip tags and using allow tags.

The tag I want to allow is <a> here is the snippit

[php]<?php $tpid = (int)edenfresh_get_theme_opts('home_featured_page_1'); $intropage = get_page($tpid); $introcontent = strip_tags($intropage->post_content,"p,br"); if (preg_match('/^.{1,80}\b/s', $introcontent, $match)) $introcontent = $match[0]; ?>[/php]

http://php.net/manual/en/function.strip-tags.php

[php]// Allow

and
echo strip_tags($text, ‘

’);[/php]

I have made a lot of progress. To give you some more information there are 4 excerpt boxes that pull in featured pages. Underneath the featured pages is a portfolio section with spacing between the two. They are all styled and wrapped in div tags so they are separate sections.

On 1 through 3 featured pages boxes I modified the code like this [php]<?php $tpid = (int)edenfresh_get_theme_opts('home_featured_page_?'); $intropage = get_page($tpid); $introcontent = strip_tags($intropage->post_content,"p,br,"); if (preg_match('/^.{1,120}\b/s', $introcontent, $match)) $introcontent = $match[0]; ?>[/php]
This worked well. The links show up properly. It prints the excerpt.

However when I do the same on the 4th box, it brings the portfolio section up to the 4th box and only prints the link.

Can someone please help me with this issue. I don’t just want the fix, I also would like to know why the last box would be different when all the code is the same for each, except for the order of the pages?

Sponsor our Newsletter | Privacy Policy | Terms of Service