Jump to content

[SOLVED] Range help


cry of war

Recommended Posts

When I use range() I under stand how to make it select all numbers that start with 1-9 and so on and the same with letters but how do I make it find all the following and anything else one might think up..

~

!

@

#

$

%

^

&

*

(

)

_

+

`

-

=

{

}

|

[

]

\

:

"

;

'

<

>

?

,

.

/

I have tried stuff like range('A','z') gives you all Caps letters + 5 characters + all lower case letters I was more looking for All characters + All caps. I searched the web and all I could find is them telling you about ranges incremental part but I have no use for that :P

 

 

Thanks for any help

 

CoW

 

 

Edit: almost forgot here is the example of where im trying to use it

 

foreach (range('A','z') as $ltr) {/*this is the part i need help with*/
$tmp[] = '\n<optgroup label='.strtoupper($ltr).'>';
$q = "SELECT * FROM `$table6` WHERE `Name` LIKE '" . $ltr . "%' ORDER BY `Name`";
$result = mysql_query($q) or die("Problem with the query: $q<br/>" . mysql_error());
if (mysql_num_rows($result) == 0){
$tmp[] = "\n<option value=''>No Items</OPTION>";
} else {
	while ($row = mysql_fetch_assoc($result)) {
$tmp[] = "\n<option value='".$row['ID']."'>".$row['Name']."</OPTION>";
	}
}
            $tmp[] = "\n</OPTGROUP>";
    }

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.