1

I have following code block in PHP:

$params = array( 
        'wsKey' => '5443', 
        'Number' => array('226340656'));

I want to convert above PHP code to AutoIt code. I tried below code

Local $params[2][2] = [['wsKey', '5443'], ['Number', '226340656']]

is it correct?

Ravi
  • 2,078
  • 13
  • 23
Mandriospo
  • 41
  • 10
  • didn't get your question can u clarify it ? – Dhruv Kapatel Dec 02 '14 at 06:17
  • [Documentation](https://www.autoitscript.com/wiki/Arrays). Looks like they are just simple arrays (kind of like in Javascript). You need a map/dictionary type of data structure. I do not know if the language has such a thing, but if it does then it should be in the documentation somewhere; go look for it. – Sverri M. Olsen Dec 02 '14 at 06:27

2 Answers2

1

It seams that you cannot create the same structure on AutoIt because demonstrated structure could be represented with hashmap(php's arrays are hashmap) only. And AutoIt has none of any datatype that related to hashmap (arrays only).

But you could try to find (or write) library which provides bunch of functions which help to work with variable like with hashmap(example)

Community
  • 1
  • 1
sectus
  • 15,605
  • 5
  • 55
  • 97
0

First of all, your question is not clear, and the following format is wrong,

$params[2][2] = [['wsKey', '5443'], ['Number', '226340656']]

if you want to create $params[2][2] array with {{'wsKey', '5443'}, {'Number', '226340656'} data you can use the following code segment.

$params[] = array('wsKey', '5443');
$params[] = array('Number', '226340656');

If print $params then following out put will display,

Array
(
    [0] => Array
        (
            [0] => wsKey
            [1] => 5443
        )

    [1] => Array
        (
            [0] => Number
            [1] => 226340656
        )

)
Jakir Hosen Khan
  • 1,498
  • 1
  • 14
  • 17