Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8936825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:18:04+00:00 2026-06-15T10:18:04+00:00

in PHP we know to make associative array using this code $variable = array(‘0001’=>’value1’,

  • 0

in PHP we know to make associative array using this code

$variable = array('0001'=>'value1', '0010'=>'value2');

and to print all keys and values using this code

foreach($variable as $key1 => $val1)
  foreach($val1 as $key2 => $val2)
    echo ("$key2 => $val2 <br />")

and the question is how to perform this in vb.net?

as i know to make associative array in vb.net using this :

Dim var As New Collection
var.Add("value1", "0001")
var.Add("value2", "0010")

how about to print value and key in vb.net like foreach in PHP? thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:18:05+00:00Added an answer on June 15, 2026 at 10:18 am

    Although i’m not familiar with PHP (anymore), i assume that associative arrays are the equivalent of a HashTable or the more modern, strongly typed Dictionary:

    Dim dict = New Dictionary(Of String, String)
    dict.Add("value1", "0001")
    dict.Add("value2", "0010")
    

    Normally you would lookup keys:

    Dim val2 = dict("value2") ' <-- 0010
    

    But if you want to enumerate it (less efficient):

    For Each kv As KeyValuePair(Of String, String) In dict
        Console.WriteLine("Key:{0} Value:{1}",kv.Key, kv.Value)
    Next
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I’m trying to make an RSS subscribers counter using PHP and don’t know where
I know php is server-side, but is there a way to make this window
I can't make the following work. I know it's because of the PHP function
not sure why my code wont work, im teaching myself javascript i know php
I know that PHP is compiled to byte code before it is run on
Is it possible to return groups as an associative array? I'd like to know
I want to learn how to make a website with C#. I know PHP,
I am looking to make a small rpg game using php/mysql/javascript but I have
I have this code: <?php for($i = 0; $i<30; $i++) { echo $i<br>; usleep(100000);
As you know php code doesn't compile to run,they are only script. but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.