php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #15881 a new format char for sprintf kind function
Submitted: 2002-03-05 11:23 UTC Modified: 2011-01-01 01:17 UTC
From: Xuefer at 21cn dot com Assigned:
Status: Wont fix Package: Strings related
PHP Version: 4.1.2 OS: all
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Xuefer at 21cn dot com
New email:
PHP Version: OS:

 

 [2002-03-05 11:23 UTC] Xuefer at 21cn dot com
i've ask ppl in irc EFnet #php.
none of them like runtime magic quote.
so.......

i would like to have the following feature:

-> sprintf("%S", $string);

which is the same function as addslashes($string);

and i can do as the following:

-> mysql_query(sprintf("UPDATE mytable SET abc='%S'", $string));


i think this would make a great change to those php-sql scripts

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-06 13:19 UTC] Xuefer at 21cn dot com
notice that it's capital "%S" not "%s"
or any other unused char
 [2002-04-01 05:37 UTC] Xuefer at 21cn dot com
no one take care of the FEATUREs?

i've forgot sth.
not only addslashes should be supported in sprintf
and also preg_quote and so on, including all "slashes"/"quote" function

and will be nice if some other useful STRING function added into sprintf

btw: i've take a look at the source code, addslashes() also invoke sprintf, don't make it infinite nested :)
 [2011-01-01 01:17 UTC] jani@php.net
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: Strings related
 [2011-01-01 01:17 UTC] jani@php.net
No need for such magic, thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC