Hi!
I user sort() but it gives me all uppercase items first.
Looking at http://ee.php.net/manual/en/function.sort.php I cannot find
what I need - tried natcasesort, but that was even more
interesting....
sort gives me (yes, I am aware of the spelling error)
Doc manager
Doc manger more
Tango
brugs
while natcasesort gives me
Doc manager
Tango
Doc manger more
brugs
and I want
brugs
Doc manager
Doc manger more
Tango
just as my alphabet is :-)
What should I user... 2 1522
On Jan 16, 10:40 am, jodleren <sonn...@hot.ee wrote:
Hi!
I user sort() but it gives me all uppercase items first.
Looking athttp://ee.php.net/manual/en/function.sort.p hpI cannot find
what I need - tried natcasesort, but that was even more
interesting....
sort gives me (yes, I am aware of the spelling error)
Doc manager
Doc manger more
Tango
brugs
while natcasesort gives me
Doc manager
Tango
Doc manger more
brugs
and I want
brugs
Doc manager
Doc manger more
Tango
just as my alphabet is :-)
What should I user...
How about this (untested):
$arr = array('foo', 'bar', 'Baz');
usort($arr, create_function ('$v1,$v2', 'return strcasecmp($v1,
$v2);'));
On Jan 16, 6:49*pm, ZeldorBlat <zeldorb...@gma il.comwrote:
On Jan 16, 10:40 am, jodleren <sonn...@hot.ee wrote:
Hi!
I user sort() but it gives me all uppercase items first.
Looking athttp://ee.php.net/manual/en/function.sort.p hpIcannot find
what I need - tried natcasesort, but that was even more
interesting....
How about this (untested):
$arr = array('foo', 'bar', 'Baz');
usort($arr, create_function ('$v1,$v2', 'return strcasecmp($v1,
$v2);'));- Hide quoted text -
Yep, that does it. Thanks
I implemented it as this, which makes it work as a normal sort.
function my_sort(&$arr)
{
usort($arr, create_function ('$v1,$v2', 'return
strcasecmp($v1, $v2);'));
} This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: dont bother |
last post by:
This is really driving me crazy.
I have a dictionary feature_vectors{}. I try to sort
its keys using
#apply sorting on feature_vectors
sorted_feature_vector=feature_vectors.keys()
sorted_feature_vector.sort()
#feature_vector.keys()=sorted_feature_vector
|
by: pmud |
last post by:
Hi,
I am using teh following code for sorting the data grid but it doesnt work.
I have set the auto generate columns to false. & set the sort expression for
each field as the anme of that field... This grid displayes results based on
users search..
public static int numberDiv;
private void Page_Load(object sender, System.EventArgs e)
{
|
by: nidhog |
last post by:
Hello guys,
I made a script that extracts strings from a binary file. It works.
My next problem is sorting those strings.
Output is like:
---- snip ----
200501221530
|
by: Pete Davis |
last post by:
A different question this time. I have a DataGrid bound to a collection. Is
there any way for me to allow sorting? The DataGrid.AllowSorting=true
doesn't work, but that's probably because it can't assume the data types and
thus can't sort them.
I thought about implementing IComparable, but I don't see how that would
work since it doesn't apply generically to all the fields/properties of the
class.
Thanks.
|
by: Richard |
last post by:
When i try sorting in the database, it sorts the numbers:
0
1
102
2
304
305
4
etc....
| |
by: Owen T. Soroke |
last post by:
Using VB.NET
I have a ListView with several columns.
Two columns contain integer values, while the remaining contain string
values.
I am confused as to how I would provide functionality to sort columns
based on the column header the user has clicked in both Ascending and
Descending formats.
|
by: jediknight |
last post by:
Hi,
I have a listview which has columns of text and columns of numerical
data.
I need to be able to sort these columns into ascending/desending order
whenever the user clicks on the column header.
The text columns are sorted correctly but the numerical columns seem
not to get sorted properly.
For example I get the following result when I try to sort a numerical
|
by: jobo |
last post by:
Hey there,
I'm having a problem getting sorting to work.
Here's what the GridView looks like:
"server" ID="updt1" Mode="Conditional">
|
by: Ahmed Yasser |
last post by:
Hi all,
i have a problem with the datagridview sorting, the problem is a bit complicated so i hope i can describe in the following steps:
1. i have a datagridview with two columns (LoginName,UserName)
2. the datagridview sorting is set to automatic, so when i click on the column header is sorts well.
3. i put in an event handler for the CellEndEdit Event, so whenever the user of the program changes the content of a cell in the LoginName...
|
by: carlos123 |
last post by:
I have a programming assignement that i have been working on for quite some time now. I need your guys' help. My assignement is to great a table with data in it. and it will have a combobox and 2 buttons to how it will be sorted( run the program and you'll see how its setup).The table will have a comboBox that includes the 4 headings. We have to use insertion and selection sorting. I have done some of the program, just need help on getting up...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |