Forum Moderators: coopster

Message Too Old, No Replies

place holders in strings with var at end

         

phazei

9:11 am on Feb 9, 2009 (gmt 0)

10+ Year Member



What's that thing called that looks something like this:

$data = array('red','yellow','purple')
echo f("Apples are %, Bananas are %, Grapes are % ", $data);

Isn't there something that does stuff like that that I can use for protection for MySQL db queries? That's what I wanted to use it for.

I can't find it or remember what it's called.

PHP_Chimp

10:01 am on Feb 9, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



are you thinking of sprintf [uk2.php.net]?

phazei

12:30 pm on Feb 9, 2009 (gmt 0)

10+ Year Member



Thank you :)

coopster

2:34 pm on Feb 10, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You may also consider the MySQLi extension [php.net] as it supports prepared statements.