php - Strip out all formatting tags of excerpt -


The author of the code below explains that it uses _excerpt_rss () because it "removes all formatting tags "Does my code" code all formatting tags "both code below? What is the difference between the two codes given below? What would you suggest?

  & lt; Meta name = "description" content = "& lt ;? php echo strip_tag (get_the_ex_script ($ post- & gt; id)) ;;" / & Gt; Vs & lt; Meta name = "description" content = "& lt; php the_excerpt_rss () ;? & gt;" / & Gt;  

By default, the_excerpt_rss () not strip html The tag parses out the link for the numbered URL footnote. In order to actually strip the tag, you have to pass 2 for the parameter $ encod_HMT (see):

$ encode_html < Br> (integer) defines HTML tag filtering and special characters such as '& amp;') encoding options are: 0 - Exits the link for the (default) numbered "url footnotes"
1 - The PHP function filters through htmlspecialchars (), but also sets the cut in 0, so it is not recommended> Cut parameters when using.
2 - Strips HTML Tags, and '& amp; With the HTML unit equivalent (& amp;) this is the default when using the> cut parameter

I will probably trust PHP Strip_tag (), because anyway __excerpt_rss () in RSS feeds Is to use, so strip_tags () I think cleaner.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -