Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

php - replicate json encoded assoc array? -


i have json string

{    "to": {       "data": [          {             "name": "f8",             "id": "11204705797"          },          {             "name": "f9",             "id": "11205705797"          }       ]    } } 

and need replicate in php, have array of name&id's this

array (     [friends] => array         (             [0] => 939394934-steve             [1] => 939394934-steve             [2] => 939394934-steve             [3] => 939394934-steve         )  ) 

and explode - id-name

how can this?

if understand correctly, want this:

$data = array(); foreach ($array['friends'] $friend) {     list($id, $name) = explode('-', $friend, 2);     $data[] = array(         'name' => $name,         'id' => $id,     ); }  $to = new stdclass; // 'to' appears object... because of {} $to->data = $data; echo json_encode(array('to'=>$to)); 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -