Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のコードを使用すると、返された配列の要素を反復処理できます。
foreach ($GLOBALS['myDB']->getAssets($i['uId']) as $x)
しかし、ループに入る前に返された配列のサイズを効率的にチェックする方法がわかりません。
何か案は?
$assets = $GLOBALS['myDB']->getAssets($i['uId']); $size = count($assets);
count を使用して、配列の長さを調べることができます
count($arrayName);