本文整理汇总了PHP中Options::getFoodPref方法的典型用法代码示例。如果您正苦于以下问题:PHP Options::getFoodPref方法的具体用法?PHP Options::getFoodPref怎么用?PHP Options::getFoodPref使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Options
的用法示例。
在下文中一共展示了Options::getFoodPref方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: json_encode
<?php
//fetching all predefined categories
require_once '../php_include/db_connection.php';
require_once '../classes/AllClasses.php';
$success = $msg = "0";
$data = array();
$option = new Options();
//all category based options
$religion = $option->getReligionOption();
$relation = $option->getRelationOption();
$education = $option->getEducationOption();
$profession = $option->getProfessionOption();
$dating_pref = $option->getDatingPref();
$food_pref = $option->getFoodPref();
$sexual_pref = $option->getSexualPref();
$smoking = $option->getSmokingOption();
$drinking = $option->getDrinkingOption();
$gender = $option->getGender();
$height = $option->getHeight();
$age = $option->getAge();
$city = $option->getCity();
$success = '1';
$msg = 'success';
echo json_encode(array('success' => $success, 'msg' => $msg, 'religion' => $religion, 'relation' => $relation, 'education' => $education, 'profession' => $profession, 'dating_pref' => $dating_pref, 'food_pref' => $food_pref, 'sexual_pref' => $sexual_pref, 'smoking' => $smoking, 'drinking' => $drinking, 'gender' => $gender, 'age' => $age, 'height' => $height, 'city' => $city));
示例2: json_encode
<?php
require_once '../php_include/db_connection.php';
require_once '../classes/AllClasses.php';
$option = new Options();
$opt = $option->getFoodPref();
$success = '1';
$msg = 'success';
echo json_encode(array('success' => $success, 'msg' => $msg, 'options' => $opt));