473,405 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Case Sensitive, Case Sensitivity, $_GET

IF, inside the address-bar, the link appears as:
index.php?CITY=Raleigh+NC
or
index.php?City=Raleigh+NC

$_GET['city'] displays behaves like a stubborn mule and refuses
to get the get and returns empty ("").

Is there a way to turn off the case sensitivity ?

Thanks.

Jim Carlock
Post replies to the group.
Mar 5 '06 #1
3 10966

Jim Carlock wrote:
IF, inside the address-bar, the link appears as:
index.php?CITY=Raleigh+NC
or
index.php?City=Raleigh+NC

$_GET['city'] displays behaves like a stubborn mule and refuses
to get the get and returns empty ("").

Is there a way to turn off the case sensitivity ?


foreach($_GET as $k => $v){
if (strtolower($k) == 'city'){
$myGetCity = $v;}
}

--
j

Mar 5 '06 #2
Jim Carlock wrote:
$_GET['city'] displays behaves like a stubborn mule and refuses
to get the get and returns empty ("").

Is there a way to turn off the case sensitivity ?


As an alternative to juglesh's suggestion, you could also change the case of
all keys of the $_GET array to lowercase using the array_change_key_case()
function:

$lc = array_change_key_case($_GET);
$city = $lc['city'];

Especially useful if there are more values to grab from the $_GET array.
JW
Mar 5 '06 #3
Jim Carlock asked:
$_GET['city'] displays behaves like a stubborn mule and refuses
to get the get and returns empty ("").

Is there a way to turn off the case sensitivity ?
"Janwillem Borleffs" <jw@jwscripts.com> suggested: As an alternative to juglesh's suggestion, you could also change
the case of all keys of the $_GET array to lowercase using the
array_change_key_case() function:

$lc = array_change_key_case($_GET);
$city = $lc['city'];

Especially useful if there are more values to grab from the
$_GET array.


Thanks, once again, Janwillem.

Going along and employing $lc, if I want to check and see if
anything exists inside the $lc array, what's the best way to do
this? Is there something that returns a TRUE or FALSE and
tells me $_GET holds stuff?

if (count($lc) != 0) {
// nothing set so show the full list
$ShowAllMenus = TRUE;
} else {
// something is set so start grabbing!
$LookAtGet = TRUE;
}

- OR -

if (isset($lc)) {
// something is set so start grabbing!
$LookAtGet = TRUE;
} else {
// nothing set so show the full list
$ShowAllMenus = TRUE;
}

- OR -

if ($lc == NULL) {
// nothing set so show the full list
$ShowAllMenus = TRUE;
} else {
// something is set so start grabbing!
$LookAtGet = TRUE;
}

Thanks, much.

Jim Carlock
Post replies to the group.
Mar 9 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

32
by: Elliot Temple | last post by:
Hi I have two questions. Could someone explain to me why Python is case sensitive? I find that annoying. Also, why aren't there multiline comments? Would adding them cause a problem of some...
9
by: Paul Smith | last post by:
This doesn't seem like it should be *that* difficult, but after quite some time trying to figure it out, I'm still banging my head against the wall. My objective is to examine the exact...
3
by: adrian suri | last post by:
Hi short question are selectors h1, h2 <script> p etc now case sensitive in the world of DHTML eg transitional / strict regards Adrian
16
by: Starwiz | last post by:
I'm a VB.net programmer, and I'm about to start working with two C++ programmers and teach them .net. I've decided to use C# in teaching them, since it's similar enough to VB.net that I can read...
3
by: Jason Tesser | last post by:
I am converting data from Access into Postgres and ran into an issue with case sensitivity. Can I write queries in Access that will be case insensitive without rewriting the queries. So I would...
1
by: othellomy | last post by:
Is SQL server defaults to case insensitive? I am sure there are ways to install case sensitive SQL server instance but coming from Sybase (which is always case sensitive) case insensitivity is...
4
by: julox | last post by:
Hello all, Just want to ask you how could I disable case sensitivity in php. I am comparing 2 strings (letters and numbers) to add to database (mysql) only non existing strings. code: if ($_GET...
2
by: Lucky | last post by:
Hi guys, I'm having problem with case sensitive collation of SQL Database. one my client is having case sensitive database. While developing the Data Layer i didn't consider this scenario. the...
11
by: Rafe | last post by:
Hi, I'm working within an application (making a lot of wrappers), but the application is not case sensitive. For example, Typing obj.name, obj.Name, or even object.naMe is all fine (as far as...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.