I have function retIKey(..):
function retIKey($text, $callback) {
return json_encode([
'inline_keyboard'=>[
[
['text'=>"$text", 'callback_data'=>"$callback"]
]
],
]);
}
I have some information that I should add to this array. I want to add ['text'=>"sql1", 'callback_data'=>"sql1"] into the array using for loop. For example, the result should be like this after the for loop:
function retIKey($text, $callback) {
return json_encode([
'inline_keyboard'=>[
[
['text'=>"$text", 'callback_data'=>"$callback"], ['text'=>"sql1", 'callback_data'=>"sql2"]
],
[
['text'=>"sql2", 'callback_data'=>"sal2"]
]
],
]);
}
What should I do? How can I do this?