Jump to content

Case sensitive variable comparison


dmccabe

Recommended Posts

I have the following code:

 

$newfirstletter = substr($row['name'], 0,1);
	if ($newfirstletter != $firstletter) {
		$firstletter = $newfirstletter;

 

It is taking the first letter of a word from the db and comparing it with the variable $newfirstletter then if they are different creating a new header.

 

However if the letter is the same but the case is different it creates a new header anyway, how can I make it case-insensitive.

Link to comment
https://forums.phpfreaks.com/topic/125917-case-sensitive-variable-comparison/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.