如何将 php 中的 foreach 函数转换为 asp 经典函数?
function startChatSession() {
$items = '';
if (!empty($_SESSION['openChatBoxes'])) {
foreach ($_SESSION['openChatBoxes'] as $chatbox => $void) {
$items .= chatBoxSession($chatbox);
}
}
如何将 php 中的 foreach 函数转换为 asp 经典函数?
function startChatSession() {
$items = '';
if (!empty($_SESSION['openChatBoxes'])) {
foreach ($_SESSION['openChatBoxes'] as $chatbox => $void) {
$items .= chatBoxSession($chatbox);
}
}
<%
If Not isNull(Session("openChatBoxes")) Then
ocbArray = SPLIT(Session("openChatBoxes"),",")
IF isArray(ocbArray) THEN
'Multiple values in Session object
For ocb = 0 to UBOUND(ocbArray)
'Loop through array and do something with each individual value
response.write ocbArray(ocb) & "<br/>" 'writes out each open chat box
Next
ELSE
'Only 1 value in Session object
END IF
End If
%>