Ios 如何在PHPWeb服务中发布nsmutable数组
我是第一次在php WebDevices中发布数组,我不知道如何在php端获取数组 请检查我的代码哪里有错误,我使用的是GET方法 这是我的iOS代码 我已经创建了这样的数组Ios 如何在PHPWeb服务中发布nsmutable数组,ios,arrays,web-services,Ios,Arrays,Web Services,我是第一次在php WebDevices中发布数组,我不知道如何在php端获取数组 请检查我的代码哪里有错误,我使用的是GET方法 这是我的iOS代码 我已经创建了这样的数组 NSMutableDictionary *yourMutableDictionary = [[NSMutableDictionary alloc] init]; [yourMutableDictionary setObject:self.btn_absen_from_date.titleLabel.text for
NSMutableDictionary *yourMutableDictionary = [[NSMutableDictionary alloc] init];
[yourMutableDictionary setObject:self.btn_absen_from_date.titleLabel.text forKey:@"from"];
[yourMutableDictionary setObject:self.btn_absen_to_date.titleLabel.text forKey:@"to"];
[yourMutableDictionary setObject:txt_Reason_absence.text forKey:@"reason"];
[ary_absence addObject:yourMutableDictionary];
NSLog(@"%@",ary_absence);
NSString *tmpValue = [NSString stringWithFormat:test,ary_absence];
NSString *tmpURL = [SITE_URL stringByAppendingString:tmpValue];
NSString* encodedUrl = [tmpURL stringByAddingPercentEscapesUsingEncoding:
NSASCIIStringEncoding];
NSURL *url = [NSURL URLWithString:encodedUrl];
NSLog(@"%@",url);
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
NSURLConnection *connnection = [[NSURLConnection alloc] initWithRequest:urlRequest delegate:self];
[connnection start];
使用NSLOG打印时,我的nsmutable数组如下所示
(
{
from = "03/February/2015";
reason = Sdfdsfdsfdsfdsffd;
to = "03/March/2015";
},
{
from = "03/April/2015";
reason = Sdfdsfdsfds;
to = "03/April/2015";
}
)
现在还不清楚你在问什么-请详细说明你的问题,公布当前结果和预期结果,以及你迄今为止为达到预期效果所做的努力。他希望在服务器端反序列化数据。但这是一种非常奇怪的格式,不像PHP结构——所以,要么改变格式,要么在服务器端解析它。首先,我已经创建了一个数组,其中包含键值from、to和Reason,这三个字段在php后端使用,那么如何在php中获得这个数组呢