-1

i am trying to do a quick reply on facebook messenger using array

$questions = array(
        "What can i help you?",
        array('Order', 'Shipping', 'How to Buy'),
        "Order Status",
        array('Status', 'Tracking', 'ETA'),
        "Check this out",
        array('Shipping Status', 'Bla bla bla', 'bb bb bb'),
        "Showing",
        array('View steps', 'View Video', 'View Steps')
    );

eg. first it will show question "what can i help you" then i will click one of the option "Order" then it should go to second array "Order Status" but if i at the first click "Shipping" it will not go to question "Order Status" but will go to the question "Check this out"

Anyone can help?

Mario Lurig
  • 783
  • 1
  • 6
  • 16

1 Answers1

0

I do not know well facebook messenger, but I guess you need something like this:

$questions = [
    "What can i help you?" => [
        [
            'Order' => [
                "Order Status" => [
                    'Status', 'Tracking', 'ETA'
                ],
            ],
            'Shipping',
            'How to Buy'
        ]
    ]
];

Since in order to show the data structure, I had to answer instead of comment.

qskane
  • 481
  • 4
  • 16