![]() TextLink' echo strip_tags ( $string ) // TextLink ![]() It is an exception to the "don't remove content" rule because it is well-designed to remove all tags. PHP's strip_tags() function will remove all HTML and PHP tags from a string. Because all output should be encoded for HTML.Įxample: ' $url = rawurlencode ( '/courses/'. When outputing a dynamic link to an HTML page, it should be encoded for the URL and also encoded for HTML. There are PHP functions which can decode these encoded strings ( htmlspecialchars_decode(), html_entity_decode()) but they are almost never needed because the browser does the decoding that matters when it processes the HTML page.īecause encoding for HTML is done frequently and because the function name is very long, most PHP developers define a custom function as a short cut." ) ?> We have to watch out for < and & as well as " and >
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |