php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #16007 Want quick shortcut for <?php echo htmlspecialchars($var) ?>
Submitted: 2002-03-11 17:55 UTC Modified: 2002-03-11 18:02 UTC
From: asd at suespammers dot org Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.1.2 OS: n/a
Private report: No CVE-ID: None
 [2002-03-11 17:55 UTC] asd at suespammers dot org
Often, I'm left writing things like:

<input type="text" name="yada" value="<?php echo htmlspecialchars($var) ?>">

It'd be nice if PHP let you write this instead:

<input tupe="text" name="yada" value="<?php $var ?>">

with the echo and htmlspecialchars implied. Or at least the echo implied.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-11 18:02 UTC] mfischer@php.net
Easily done, write your own function 'h($a) { return htmlspecialchars($a);}', your call could then look like '<?=h($var)?>'
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 12:01:29 2024 UTC