1
cm2339
php querystring and case insensitivity
  • 2005/8/8 20:26

  • cm2339

  • Just popping in

  • Posts: 32

  • Since: 2005/2/21


I added a one page script to the XOOPS framework using this as my guide: https://xoops.org/modules/smartfaq/faq.php?faqid=253

That worked great but my problem is more specific to PHP.

How can I read a variable from the querystring if the case does not match? Example: I want the value for 'subject' when the querystring could look like any of the following:

contact.php?subject=Blah
contact.php?Subject=Blah+Blah
contact.php?SUbject=Blah%20Blah%20Blah

Obviously there may be more variations but you get the idea.

I need to use the php script to pull this off. Adding a rewrite rule to Apache for this issue is out of the question for this project.

Thanks for any help!

2
Dave_L
Re: php querystring and case insensitivity
  • 2005/8/8 20:50

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


For PHP >= 4.2.0, this should work:

$get array_change_key_case($_GET); // change array keys to lowercase
$subject $get['subject'];

3
cm2339
Re: php querystring and case insensitivity
  • 2005/8/9 18:04

  • cm2339

  • Just popping in

  • Posts: 32

  • Since: 2005/2/21


THANKS! That works great! I will file that away for future reference.

Again - Thank You!

Login

Who's Online

131 user(s) are online (45 user(s) are browsing Support Forums)


Members: 0


Guests: 131


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits