Wednesday, October 10, 2012

how to encode and decode html tag using php


how to encode and decode html tag using php
you can encode using ->
html_entities(mysql_real_escape_string($variable));

you can decoe using
html_entity_decode(stripslashes($variable));

Tuesday, October 9, 2012

how to remove html tag in a string using php

<?php
    $input = "<div id='bikash'><b>this is the html tag remove in php</b></div><strong>me use for html you do nt use</strong>";

   echo  $b = strip_tags($input, "<strong><em>");
?>