Beispiel #1
0
        public static PHPArray array(params object[] objs)
        {
            PHPArray ary = new PHPArray();

            foreach (object obj in objs)
            {
                ary.Add(obj);
            }
            return(ary);
        }
Beispiel #2
0
        public static PHPArray array(string[] keys, object[] objs)
        {
            if (keys.Length != objs.Length)
            {
                throw new ArgumentException("数组数量不一样");
            }
            PHPArray ary = new PHPArray();

            for (int i = 0; i < keys.Length; i++)
            {
                ary.Add(keys[i], objs[i]);
            }
            return(ary);
        }