Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    May 2012
    Posts
    2

    Question How to Use "strip_tags" string function?

    How to Use "strip_tags" string function?

  2. #2
    Senior Member
    Join Date
    Nov 2011
    Location
    USA
    Posts
    172
    The strip_tags() function is used to strips a string from HTML, XML, and PHP tags.
    It has mainly two parameters
    1) String:- specifies string to check
    2) Allow:- specifies allowable tags and will not be removed
    Syntax:-
    strip_tags(string,allow)
    Example:-
    <?php
    echo strip_tags("This is an example of strip tags");
    ?>
    The output is: - This is an example of strip tags
    You can get more idea at http://www.w3schools.com/php/func_string_strip_tags.asp
    Last edited by AllenSantiago; 09-12-2012 at 06:20 AM.

  3. #3
    Junior Member
    Join Date
    Jun 2012
    Posts
    25
    I think above mentioned way is best,
    you have to follow this.

  4. #4
    Registered User
    Join Date
    Jun 2012
    Location
    Los Angeles
    Posts
    1
    <?php
    $text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>';
    echo strip_tags($text);
    echo "\n";

    // Allow <p> and <a>
    echo strip_tags($text, '<p><a>');
    ?>

  5. #5
    Senior Member
    Join Date
    Sep 2009
    Posts
    136
    http://php.net/manual/en/function.strip-tags.php

    It is pretty simple and I don't think it needs any further explanation. If you still have any SPECIFIC issue, please make it clear.
    ECVPS - High Quality service, Free port monitor , Fully Managed Service
    Website : http://www.ecvps.com || VPS Hosting, 24/7 Ticket Support & Live Chat
    Call Us : +852 3485 0037

  6. #6
    Junior Member
    Join Date
    Jul 2012
    Posts
    10
    <?php
    $text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>';
    echo strip_tags($text);
    echo "\n";

    // Allow <p> and <a>
    echo strip_tags($text, '<p><a>');
    ?>

  7. #7
    Senior Member
    Join Date
    Jul 2018
    Location
    Chennai
    Posts
    138

    How to Use "strip_tags" string function?

    Awesome post about Liferay it's really great...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

  Find Web Hosting      
  Shared Web Hosting UNIX & Linux Web Hosting Windows Web Hosting Adult Web Hosting
  ASP ASP.NET Web Hosting Reseller Web Hosting VPS Web Hosting Managed Web Hosting
  Cloud Web Hosting Dedicated Server E-commerce Web Hosting Cheap Web Hosting


Premium Partners:


Visit forums.thewebhostbiz.com: to discuss the web hosting business, buy and sell websites and domain names, and discuss current web hosting tools and software.