ループの結果を配列に追加しようとしています。
これが私のコードです:
<cfset mobNumbers = ArrayNew(1)>
<cfloop query = "staffLoop">
<cfscript>
mobileNo = staffLoop.mobileno;
mobileNo = mobileNo.replaceAll("[^0-9]", "");
ext = staffLoop.extension;
ext = ext.replaceAll("[^0-9]", "");
if (Left(mobileNo, 2) == "07" || Left(mobileNo, 3) == "447") {
recipient = mobileNo;
} else if (Left(ext, 2) == "07" || Left(ext, 3) == "447") {
recipient = ext;
} else {
recipient = "";
}
if (Left(recipient, 2) == "07") {
recipient = "447" & Right(recipient, Len(recipient) - 2);
}
if (Len(recipient) == 12) {
[send text code]
}
</cfscript>
</cfloop>
<cfset ArrayAppend(mobNumbers, "recipient")>
目標は、すべての携帯電話番号の配列を取得することです。
私のコードは機能していません、そして私はいくつかの調査の後で、私は何をすべきかわかりません。何か案は?
可能であれば、ソリューションに非cfscriptを使用したいのですが、cfscriptを使用する方が簡単な場合は、それで問題ありません。