I am using x editable for inline editing.
JQUERY
$('#status').editable({
value: 2,
source: [
{value: 1, text: 'Active'},
{value: 2, text: 'Blocked'},
{value: 3, text: 'Deleted'}
]
});
This one is running fine. But the problem is, I want to get source options from php
. For that I have an array.
PHP
$php_array = Array ( [MOBILE_TOPUP] => MOBILE_TOPUP
[PICKUP] =>PICKUP
[DELIVERY] => DELIVERY
[BANK_DEPOSIT] => BANK_DEPOSIT )
I tried with by passing below variable in source but it's not working:
var json_array = <?=json_encode($php_array)?>;
How can I achieve this? Do I need to change array structure in PHP
? Thanks for any help!