<?php
function in_array_all($needles, $haystack) {
}
$_POST['palavra'] = "Tudo bem com você ?";
$palavrasChaves = ["você", "bem", "?"];
if (isset($_POST['palavra']) && $palavra = $_POST['palavra']) {
if (in_array_all($palavrasChaves, $pedacos)) {
echo "Bem e você ?";
} else {
echo "Não estou bem.";
}
}
PD9waHAKCmZ1bmN0aW9uIGluX2FycmF5X2FsbCgkbmVlZGxlcywgJGhheXN0YWNrKSB7CiAgIHJldHVybiAhYXJyYXlfZGlmZigkbmVlZGxlcywgJGhheXN0YWNrKTsKfQoKJF9QT1NUWydwYWxhdnJhJ10gPSAiVHVkbyBiZW0gY29tIHZvY8OqID8iOwoKJHBhbGF2cmFzQ2hhdmVzID0gWyJ2b2PDqiIsICJiZW0iLCAiPyJdOwoKaWYgKGlzc2V0KCRfUE9TVFsncGFsYXZyYSddKSAmJiAkcGFsYXZyYSA9ICRfUE9TVFsncGFsYXZyYSddKSB7CiAgICAkcGVkYWNvcyAgPSBleHBsb2RlKCcgJywgJHBhbGF2cmEpOwoKICAgIGlmIChpbl9hcnJheV9hbGwoJHBhbGF2cmFzQ2hhdmVzLCAkcGVkYWNvcykpIHsKICAgICAgICBlY2hvICJCZW0gZSB2b2PDqiA/IjsKICAgIH0gZWxzZSB7CiAgICAgICAgZWNobyAiTsOjbyBlc3RvdSBiZW0uIjsKICAgIH0KfQ==