0
                for($reg3=0; $reg3<strlen($str); $reg3++)
                {
                    $reg0 = $str[$reg3];

                        switch($reg0)
                        {
                            case '0': $reg1[] = '0000'; break;
                            case '1': $reg1[] = '0001'; break;
                            case '2': $reg1[] = '0010'; break;
                            case '3': $reg1[] = '0011'; break;
                            case '4': $reg1[] = '0100'; break;
                            case '5': $reg1[] = '0101'; break;
                            case '6': $reg1[] = '0110'; break;
                            case '7': $reg1[] = '0111'; break;
                            case '8': $reg1[] = '1000'; break;
                            case '9': $reg1[] = '1001'; break;
                            case 'a': $reg1[] = '1010'; break;
                            case 'b': $reg1[] = '1011'; break;
                            case 'c': $reg1[] = '1100'; break;
                            case 'd': $reg1[] = '1101'; break;
                            case 'e': $reg1[] = '1110'; break;
                            case 'f': $reg1[] = '1111'; break;
                        }
                }

                $reg1 = join($reg1);
3
  • You can use decbin(hexdec($reg0)); instead of big switch, but anyway, what is the question? Commented Mar 27, 2011 at 12:49
  • i wanted to convert this code to vb.net but what should i do with array length?..in php code array length is dynamic Commented Mar 27, 2011 at 12:53
  • is there a way to dynamically declare the size of an array in vb.net Commented Mar 27, 2011 at 12:55

1 Answer 1

1

Work with a List, that way you can work dynamic.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.