我有下面的代碼塊在PHP中:陣列陣列PHP來的AutoIt
$params = array(
'wsKey' => '5443',
'Number' => array('226340656'));
我想上面的PHP代碼AutoIt的代碼轉換。我試過下面的代碼
Local $params[2][2] = [['wsKey', '5443'], ['Number', '226340656']]
它是正確的嗎?
我有下面的代碼塊在PHP中:陣列陣列PHP來的AutoIt
$params = array(
'wsKey' => '5443',
'Number' => array('226340656'));
我想上面的PHP代碼AutoIt的代碼轉換。我試過下面的代碼
Local $params[2][2] = [['wsKey', '5443'], ['Number', '226340656']]
它是正確的嗎?
它接縫不能在AutoIt上創建相同的結構,因爲展示的結構可能僅使用散列圖(php's arrays are hashmap)表示。 AutoIt沒有任何與hashmap相關的數據類型(arrays only)。
但是你可以嘗試尋找(或寫)庫,它提供了一堆功能,這有助於可變的工作像的HashMap(example)
首先,你的問題不明確,以及下面的格式是錯誤的,
$params[2][2] = [['wsKey', '5443'], ['Number', '226340656']]
如果你想創建$ PARAMS [2] [2]數組{{ 'wsKey', '5443'},{ '號碼'
, '226340656'}中的數據可以使用以下代碼段。
$params[] = array('wsKey', '5443');
$params[] = array('Number', '226340656');
如果打印$ PARAMS然後下面放出來會顯示,
Array
(
[0] => Array
(
[0] => wsKey
[1] => 5443
)
[1] => Array
(
[0] => Number
[1] => 226340656
)
)
是它的AutoIt代碼? – Mandriospo 2014-12-02 20:22:12
沒有得到你的問題u能澄清呢? – Dhruv 2014-12-02 06:17:39
[文檔](https://www.autoitscript.com/wiki/Arrays)。看起來他們只是簡單的數組(有點像在Javascript中)。你需要一個地圖/詞典類型的數據結構。我不知道這個語言是否有這樣的事情,但如果它確實存在,那麼它應該在文檔的某個地方;去尋找它。 – 2014-12-02 06:27:33