RiksAndroid
RiksAndroid

Reputation: 825

filter an array using ajax in php

I read similar questions here, but didn't find my answer. Actually i have an array of data which i am passing to my view file from my controller. There i am iterating through it to show data in the table like below:

AbcController(abcAction) :

$this->view->array = $array;

and it's corresponding view file : abc.phtml :

<?php foreach($this->array as $object){ ?> *** table to display data*** <?php }?>

I am able to sort through postback but i want to sort this data through ajax call. i had done sorting logic in my controller. Ajax call should return this sorted array which i will show in table as i am showing above in phtml file. What i had learned in ajax, i am not able to implement it. Can anyone help me out in this.

Thanks

Upvotes: 0

Views: 575

Answers (1)

Case
Case

Reputation: 4272

json_decode and json_encode. Is what I believe you are asking for.

Upvotes: 1

Related Questions