I just added some custom fields for users. So 'api' is one of them.
function abc(){
$current_user = wp_get_current_user();
print_r(get_user_meta($current_user->id)['api'][0]);
}
add_action('init', 'abc');
And the result I get is a string:
a:2:{i:0;s:9:"paybphone";i:1;s:3:"ips";}
I don't know how to access "i" value from the PHP code as its string. And I also know its not JSON , so I also can't use 'json_encode()' function. Please help me out ! I am new to Wordpress programming.