Page 1 of 1

convert form data into all CAPS

Posted: Mon Aug 11, 2014 4:17 pm
by donny
hello,

i have a form with name and address and i want to change all their inputed data to capitals. i see how to do this for 1 variable on the php site but is there a way to make 1 function change multiple variables while keeping the variables the same name?

thank you

$name = john doe
$address = 123 sesame street


turn into

$name = JOHN DOE
$address = 123 SESAME STREET

thank you

Re: convert form data into all CAPS

Posted: Mon Aug 11, 2014 4:26 pm
by requinix
Yes, but they're basically all the same as just calling strtoupper() on each one individually.

So just do it normally, such as

Code: Select all

$name = strtoupper($_POST["name"]);
$address = strtoupper($_POST["address"]);

Re: convert form data into all CAPS

Posted: Mon Aug 11, 2014 4:26 pm
by donny
thank you very much