Hello
I want to array with key and valu in vb.net
as like in php

$array['name']="xyz";
$array['surname']="abc";

so is this possible ?
please any suggestion.

Thanks in advance

Hello
I want to array with key and valu in vb.net
as like in php

$array['name']="xyz";
$array['surname']="abc";

so is this possible ?
please any suggestion.

Thanks in advance

>I want to array with key and valu in vb.net
as like in php. so is this possible ?

No

You may use Hashtable class from System.Collections namespace for that purpose. Hashtable instance represents data in key-value pair form.

Here is a sample:

.....
        Dim rec As New System.Collections.Hashtable
        rec.Add("roll", 10)
        rec("name") = "Ronny"
        rec("bdate") = Date.Parse("12-31-1990")

        For Each n In rec.Values
            Console.WriteLine(n)
        Next
        .....

Thank you
i dont know this m php programer only so........

Thanks avd. Hashtable good think :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.