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

  • SEARCH
  • Home
  • 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 8705579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:23:51+00:00 2026-06-13T03:23:51+00:00

I want to convert this C# code to PHP code. class Members { public

  • 0

I want to convert this C# code to PHP code.

class Members
{
    public int ID { get; set; }
    public string Name { get; set; }
    public string Surname { get; set; }
}

class Process
{

    Dictionary<string, Members> MemberList = new Dictionary<string, Members>();
    public Process()
    {

        //GetMembersMethod();
        //Fill MemberList
        //example
        //MemberList.Add(userid,new Members{id=@id,name=@name,surname=@surname});
    }

    void WriteMembers() {
        foreach (string item in MemberList.Keys)
        {
            Console.WriteLine(MemberList[item].ID);
            Console.WriteLine(MemberList[item].Name);
            Console.WriteLine(MemberList[item].Surname);
        }
    }
}

How I can code this c# example in PHP? How can I code the loop to dictionary using array classes with PHP?

Edit..

I coded 2 days ago this code;
I want to like to this..

<?php
class CKN
    {
        public $Name= 'ozan';
        public $Surname= 'ckn';
        public $ID = '12';
    }
    $class = new CKN();
    for($i=0; $i<10; $i++){
        $class_temp= new CKN();
        $class_temp->Name="ozan".$i;
        $class_temp->Surname="CKN".$i;  
        $class_temp->ID="CKN".$i;
        $arr[$i]=(object)$class_temp;
    }
    foreach($arr as $key => $value) {
        $temp=new (CKN)$value;
        foreach($temp as $k=>$v){
            print "$k=> $v <br>";
        }
    }
    ?>
  • 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-13T03:23:52+00:00Added an answer on June 13, 2026 at 3:23 am

    You could try using http://jsc.sourceforge.net/, which assists with .net to javascript, actionscript or php.

    If you want to do it yourself:

    1. Classes are declared in pretty much the same way
    2. Dictionaries are loosely reducible to hashmaps, which can be substituted by php “arrays”
    3. Replace the console with your desired output stream.
    4. Remove typed declarations. All variables start with $.

    I might have missed something, but that should get you started. Good luck.

    EDIT: Here is code that I think does what you need. You can test it here:

    <?php
    class CKN
    {
        public $Name= 'ozan';
        public $Surname= 'ckn';
        public $ID = '12';
    }
    for($i=0; $i<10; $i++){
        $class_temp= new CKN();
        $class_temp->Name="ozan".$i;
        $class_temp->Surname="CKN".$i;  
        $class_temp->ID="CKN".$i;
        $arr[$i]=$class_temp;
    }
    foreach($arr as $key => $value) {
        foreach($value as $k=>$v){
            print "$k=> $v <br>";
        }
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to convert this url: module-apple-get.html?term=st to file.php?module=apple&func=get&term=st I 've wrote this code
I want to convert vb this code <?php // Where the file is going
I want to convert this code into PHP, it's a function that hides layers
I have this php code saved in text file, I want to convert this
I want to convert this php code snippet that converts/truncates a value: here is
i want to convert this string into DateTime. Tue Aug 19 15:05:05 +0000 2008
Say I have the string 1,2,3,4,5 and I want to convert this to an
I have a date in String format, mm/dd/yyyy I want to convert this to
I am having string str = [123, 345, 567]. I want to convert this
I want to convert my php code to python code. Is it possible $secret

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.