本文整理汇总了PHP中quotes_to_entities函数的典型用法代码示例。如果您正苦于以下问题:PHP quotes_to_entities函数的具体用法?PHP quotes_to_entities怎么用?PHP quotes_to_entities使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了quotes_to_entities函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_quotes_to_entities
public function test_quotes_to_entities()
{
$strs = array('"me oh my!"' => '"me oh my!"', "it's a winner!" => 'it's a winner!');
foreach ($strs as $str => $expect) {
$this->assertEquals($expect, quotes_to_entities($str));
}
}
示例2: inserir
public function inserir($tarefa)
{
$this->load->helper('string');
// hack pra converter data do input html5 no formato mysql
$ano = date("Y", strtotime($tarefa['data_inicio']));
$mes = date("m", strtotime($tarefa['data_inicio']));
$dia = date("d", strtotime($tarefa['data_inicio']));
$anop = date("Y", strtotime($tarefa['data_prazo']));
$mesp = date("m", strtotime($tarefa['data_prazo']));
$diap = date("d", strtotime($tarefa['data_prazo']));
// instancia o objeto
$this->codigo = NULL;
$this->titulo = $tarefa['titulo'];
$this->descricao = quotes_to_entities($tarefa['descricao']);
$this->prioridade = $tarefa['prioridade'];
$this->data_inicio = $ano . '-' . $mes . '-' . $dia;
$this->data_prazo = $anop . '-' . $mesp . '-' . $diap;
$this->data_fim = NULL;
$this->criado_por = $tarefa['criado_por'];
$this->codigo_projeto = $tarefa['codigo_projeto'];
$this->codigo_usuario = $tarefa['lider'][0];
// usuário ativo
$this->codigo_status = $tarefa['codigo_status'];
// echo "<pre>";
// var_dump($this);
// echo "</pre>";
if ($this->db->insert('tarefa', $this)) {
$inserido = $this->db->insert_id();
return true;
//<br>Código: " . $inserido;
} else {
return false;
}
}
示例3: acceptData
function acceptData($value)
{
foreach ($value as $key => $val) {
$data[$val] = $this->SV->input->post($val, TRUE);
if (!is_array($data[$val])) {
$data[$val] = strip_image_tags($data[$val]);
$data[$val] = quotes_to_entities($data[$val]);
$data[$val] = encode_php_tags($data[$val]);
$data[$val] = trim($data[$val]);
}
}
return $data;
}
示例4: create
function create($id)
{
$this->load->model('EventReview_model');
$userName = $this->input->post('userName');
$event_id = $this->input->post('event_id');
$rating = $this->input->post('rating');
$reviewContent = $this->input->post('reviewContent');
$reviewContent = nl2br($reviewContent);
$reviewContent = quotes_to_entities($reviewContent);
if ($userName && $event_id && $rating && $reviewContent) {
$this->EventReview_model->create_event_review($userName, $event_id, $rating, $reviewContent);
}
$data['result'] = $this->EventReview_model->get_all_event_reviews();
redirect('event/view_event_reviewed/' . $id);
}
示例5: edit_bar
function edit_bar()
{
if ($this->session->userdata('admin') != TRUE) {
redirect('dashboard/index');
}
$this->load->model('Bar_model');
$name = $this->input->post('name');
$description = $this->input->post('description');
$description = nl2br($description);
$description = quotes_to_entities($description);
$address = $this->input->post('address');
$weburl = $this->input->post('weburl');
if ($name) {
$this->Bar_model->edit_bar($name, $description, $address, $weburl);
}
$data['result'] = $this->Bar_model->get_all_bars();
$this->load->view('header');
$this->load->view('Bar/Bar_view', $data);
$this->load->view('footer');
}
示例6: create
function create($name)
{
$this->load->model('BarReview_model');
$userName = $this->input->post('userName');
$barName = $this->input->post('barName');
$approvedByAdmin = $this->input->post('approvedByAdmin');
$rating = $this->input->post('rating');
$reviewContent = $this->input->post('reviewContent');
$reviewContent = nl2br($reviewContent);
$reviewContent = quotes_to_entities($reviewContent);
$ts = $this->input->post('ts');
if ($userName && $barName && $approvedByAdmin && $rating && $reviewContent && $ts) {
$this->BarReview_model->create_barreview($userName, $barName, $approvedByAdmin, $rating, $reviewContent, $ts);
} else {
if ($userName && $barName && $rating && $reviewContent) {
$this->BarReview_model->create_barreview_simple($userName, $barName, $rating, $reviewContent);
}
}
$data['result'] = $this->BarReview_model->get_all_barreviews();
redirect('bar/viewBarReviewed/' . $name);
}
示例7: create
function create($name)
{
$this->load->model('drink_review_model');
$user_name = $this->input->post('user_name');
$drink_name = $this->input->post('drink_name');
$approved_by_admin = $this->input->post('approved_by_admin');
$rating = $this->input->post('rating');
$review_content = $this->input->post('review_content');
$review_content = nl2br($review_content);
$review_content = quotes_to_entities($review_content);
$ts = $this->input->post('ts');
if ($user_name && $drink_name && $approved_by_admin && $rating && $review_content && $ts) {
$this->drink_review_model->create_drink_review($user_name, $drink_name, $approved_by_admin, $rating, $review_content, $ts);
} else {
if ($user_name && $drink_name && $rating && $review_content) {
$this->drink_review_model->create_drink_review_simple($user_name, $drink_name, $rating, $review_content);
}
}
$data['result'] = $this->drink_review_model->get_all_drink_reviews();
redirect('Drink/view_drink_reviewed/' . $name);
}
示例8: save_field
/**
* Save (Create/Edit) a Member Field
* @param array $data Associative array of data matching columns in
* exp_member_fields
* @return array Modified $data associative array, containing
* defaults and sanitized values
*/
public function save_field($data = array())
{
if (!is_array($data)) {
throw new Exception('Data passed to Member_field_model::save() must be an array');
}
// Sanitize fields allowed
$fields = ee()->db->list_fields('member_fields');
$data = array_intersect_key($data, array_flip($fields));
// Clean up field list items
if (isset($data['m_field_list_items']) && $data['m_field_list_items'] != '') {
$data['m_field_list_items'] = quotes_to_entities($data['m_field_list_items']);
}
// Determine field order
if (empty($data['m_field_order']) or !is_numeric($data['m_field_order'])) {
ee()->load->model('member_model');
$count = ee()->member_model->count_records('member_fields');
$data['m_field_order'] = $count + 1;
}
// Set a default max length
$data['m_field_maxl'] = is_numeric($data['m_field_maxl']) ? $data['m_field_maxl'] : 100;
// Ensure defaults are there
$defaults = array('m_field_description' => '', 'm_field_list_items' => '');
$data = array_merge($defaults, $data);
// New Field
ee()->load->dbforge();
if (!isset($data['m_field_id'])) {
ee()->db->insert($this->table_fields, $data);
ee()->dbforge->add_column($this->table_data, $this->_field_settings(ee()->db->insert_id(), $data['m_field_type'], $data['m_field_maxl']));
} else {
// Alter column if field type changed
$previous_data = $this->get_field_information($data['m_field_id']);
if ($previous_data['m_field_type'] !== $data['m_field_type']) {
ee()->dbforge->modify_column($this->table_data, $this->_field_settings($data['m_field_id'], $data['m_field_type'], $data['m_field_maxl'], FALSE));
}
ee()->db->update($this->table_fields, $data, array('m_field_id' => $data['m_field_id']));
}
return $data;
}
示例9: strip_slashes
function strip_slashes($input)
{
$this->load->helper('string');
if (is_array($input)) {
foreach ($input as $k => $v) {
$input[$k] = quotes_to_entities($v);
}
} else {
$input = quotes_to_entities($input);
}
return $input;
}
示例10: set_TDK
public function set_TDK($array, $add = FALSE)
{
if (count($array) > 0) {
if (isset($array['seo_title'])) {
$this->add_title(quotes_to_entities($array['seo_title']), $add);
}
if (isset($array['seo_description'])) {
$this->add_description(quotes_to_entities($array['seo_description']), $add);
}
if (isset($array['seo_keywords'])) {
$this->add_keywords(quotes_to_entities($array['seo_keywords']), $add);
}
}
return $this;
}
示例11: edit
/**
* Редактирование
* выделенных серверов
* игровых серверов
* игр
* типов игр
*
* @param string - тип
* dedicated_servers - выделенные серверы
* game_servers - игровые серверы
* games - игры
* type_games - типы игр
*
* @param string - служит для передачи дополнительных параметров
* @param string
*
*
*/
public function edit($type = 'dedicated_servers', $id = false, $param_2 = false)
{
$local_tpl = array();
$error_msg = false;
switch ($type) {
case 'dedicated_servers':
/* -------------------------------------------- */
/* Выделенные серверы */
/* -------------------------------------------- */
$this->load->model('servers/dedicated_servers');
if (!$this->dedicated_servers->get_ds_list(array('id' => $id), 1)) {
$this->_show_message(lang('adm_servers_server_not_found'), site_url('adm_servers/view/dedicated_servers'));
return false;
}
// Файл шаблона с формой
$tpl_file_edit = 'adm_servers/dedicated_servers_control.html';
$tpl_list = $this->dedicated_servers->tpl_data_ds();
$local_tpl = $tpl_list[0];
//if(in_array('ssh2', get_loaded_extensions()));
$options = array('gdaemon' => 'GameAP Daemon', 'ssh' => 'SSH', 'telnet' => 'Telnet');
if ($this->dedicated_servers->ds_list['0']['control_protocol'] == 'local') {
// Поле Local отображается лишь для локального сервера
// Однако можно вручную подменить значения в html коде,
// но в этом нет ничего страшного
$options['local'] = 'Local';
}
$local_tpl['control_protocol'] = form_dropdown('control_protocol', $options, $this->dedicated_servers->ds_list['0']['control_protocol']);
// Скрипты
$local_tpl['script_start'] = quotes_to_entities($this->dedicated_servers->ds_list['0']['script_start']);
$local_tpl['script_stop'] = quotes_to_entities($this->dedicated_servers->ds_list['0']['script_stop']);
$local_tpl['script_restart'] = quotes_to_entities($this->dedicated_servers->ds_list['0']['script_restart']);
$local_tpl['script_status'] = quotes_to_entities($this->dedicated_servers->ds_list['0']['script_status']);
$local_tpl['script_get_console'] = quotes_to_entities($this->dedicated_servers->ds_list['0']['script_get_console']);
$local_tpl['script_send_command'] = quotes_to_entities($this->dedicated_servers->ds_list['0']['script_send_command']);
$local_tpl['script_path'] = $this->dedicated_servers->ds_list['0']['script_path'];
$local_tpl['steamcmd_path'] = $this->dedicated_servers->ds_list['0']['steamcmd_path'];
$local_tpl['gdaemon_host'] = $this->dedicated_servers->ds_list['0']['gdaemon_host'];
$local_tpl['gdaemon_key'] = $this->dedicated_servers->ds_list['0']['gdaemon_key'];
$local_tpl['ssh_host'] = $this->dedicated_servers->ds_list['0']['ssh_host'];
$local_tpl['ssh_login'] = $this->dedicated_servers->ds_list['0']['ssh_login'];
$local_tpl['ssh_path'] = $this->dedicated_servers->ds_list['0']['ssh_path'];
$local_tpl['telnet_host'] = $this->dedicated_servers->ds_list['0']['telnet_host'];
$local_tpl['telnet_login'] = $this->dedicated_servers->ds_list['0']['telnet_login'];
$local_tpl['telnet_path'] = $this->dedicated_servers->ds_list['0']['telnet_path'];
$local_tpl['ftp_host'] = $this->dedicated_servers->ds_list['0']['ftp_host'];
$local_tpl['ftp_login'] = $this->dedicated_servers->ds_list['0']['ftp_login'];
$local_tpl['ftp_path'] = $this->dedicated_servers->ds_list['0']['ftp_path'];
$local_tpl['disabled_checkbox'] = form_checkbox('disabled', 'accept', $this->dedicated_servers->ds_list['0']['disabled']);
// Получаем список серверов на DS
$gs = $this->servers->get_game_servers_list(array('ds_id' => $id));
$local_tpl['servers_list'] = $this->servers->tpl_data();
/*
* Правила для формы
*
* Документация:
* http://cidocs.ru/213/libraries/form_validation.html
*
*/
$this->form_validation->set_rules('name', lang('title'), 'trim|required|max_length[64]|min_length[3]|xss_clean');
$this->form_validation->set_rules('os', lang('operationg_system'), 'trim|required|max_length[64]|min_length[3]|xss_clean');
$this->form_validation->set_rules('location', lang('adm_servers_location'), 'trim|required|max_length[64]|min_length[3]|xss_clean');
$this->form_validation->set_rules('provider', 'adm_servers_provider', 'trim|max_length[64]|min_length[3]|xss_clean');
$this->form_validation->set_rules('ip', 'IP', 'trim|required|xss_clean');
$this->form_validation->set_rules('ram', 'RAM', 'trim|max_length[64]|xss_clean');
$this->form_validation->set_rules('cpu', 'CPU', 'trim|max_length[64]|xss_clean');
// Скрипты
$this->form_validation->set_rules('script_start', lang('adm_servers_command_start'), 'trim|max_length[256]|xss_clean');
$this->form_validation->set_rules('script_stop', lang('adm_servers_command_stop'), 'trim|max_length[256]|xss_clean');
$this->form_validation->set_rules('script_restart', lang('adm_servers_command_restart'), 'trim|max_length[256]|xss_clean');
$this->form_validation->set_rules('script_status', lang('adm_servers_command_status'), 'trim|max_length[256]|xss_clean');
$this->form_validation->set_rules('script_get_console', lang('adm_servers_command_get_console'), 'trim|max_length[256]|xss_clean');
$this->form_validation->set_rules('script_send_command', lang('adm_servers_send_command'), 'trim|max_length[256]|xss_clean');
// Редактирование данных доступа к серверу (пароли ftp, ssh)
$this->form_validation->set_rules('steamcmd_path', lang('adm_servers_steamcmd_path'), 'trim|max_length[256]|xss_clean');
$this->form_validation->set_rules('script_path', lang('adm_servers_script_path'), 'trim|max_length[256]|xss_clean');
$this->form_validation->set_rules('gdaemon_host', lang('adm_servers_gdaemon_host'), 'trim|max_length[64]|xss_clean');
$this->form_validation->set_rules('gdaemon_key', lang('adm_servers_gdaemon_key'), 'trim|max_length[64]|xss_clean');
$this->form_validation->set_rules('ssh_host', lang('adm_servers_ftp_host'), 'trim|max_length[64]|xss_clean');
$this->form_validation->set_rules('ssh_login', 'SSH login', 'trim|max_length[64]|xss_clean');
$this->form_validation->set_rules('ssh_password', 'SSH password', 'trim|max_length[64]|xss_clean');
$this->form_validation->set_rules('ssh_path', 'Path SSH', 'trim|max_length[256]|xss_clean');
$this->form_validation->set_rules('telnet_host', lang('adm_servers_telnet_host'), 'trim|max_length[64]|xss_clean');
//.........这里部分代码省略.........
示例12: _parse_single
public function _parse_single($key, $val, $string)
{
$newval = $val;
$find = "/" . $this->l_delim . "" . $key . ".*" . $this->r_delim . "/U";
preg_match($find, $string, $matches);
if (!empty($matches)) {
$temp = trim($matches[0], "{}");
$res = explode(":", $temp);
// var_dump($res);
if (count($res) > 1) {
switch ($res[1]) {
case "allcaps":
$newval = strtoupper($val);
break;
case "money":
$newval = number_format((int) $val, 2, ".", ",");
break;
case "caps":
$newval = ucwords(strtolower($val));
break;
case "nocaps":
$newval = strtolower($val);
break;
case "ucfirst":
$newval = ucfirst($val);
break;
case "bool1":
$newval = $val == 1 ? "True" : "False";
break;
case "bool2":
$newval = $val == 1 ? "Yes" : "No";
break;
case "bool3":
$newval = $val == 1 ? "Active" : "Inactive";
break;
case "climit":
$int = count($res) < 3 ? 128 : $res[2];
$newval = character_limiter($val, $int);
break;
case "htmlchars":
$newval = quotes_to_entities($val);
break;
case "wlimit":
$int = count($res) < 3 ? 25 : $res[2];
$newval = word_limiter($val, $int);
break;
case "wrap":
$int = count($res) < 3 ? 76 : $res[2];
$newval = word_wrap($val, $int);
break;
case "hilite":
$str = count($res) < 3 ? "" : $res[2];
$color = count($res) < 4 ? "#990000" : $res[3];
$newval = highlight_phrase($val, $str, "<span style=\"color:{$color}\">", "</span>");
break;
case "safe_mailto":
$alt_text = count($res) < 3 ? "" : $res[2];
$newval = safe_mailto($val, $alt_text);
break;
case "url_title":
$sep = count($res) < 3 ? "dash" : $res[2];
$newval = url_title($val, $sep);
break;
case "remove_img":
$newval = strip_image_tags($val);
break;
case "hash":
$hash = count($res) < 3 ? "md5" : $res[2];
$newval = dohash($val, $hash);
break;
case "stripslashes":
$newval = stripslashes($val);
break;
case "strip_tags":
$allowed = count($res) < 3 ? "" : $res[2];
$newval = strip_tags($val, $allowed);
break;
/** other output string format options here **/
}
return str_replace($matches[0], $newval, $string);
}
}
return parent::_parse_single($key, $val, $string);
}
示例13: jquery_tab_open
<?php
echo jquery_tab_open(array('main' => 'Site', 'shifts' => 'Shift Times', 'assignments' => 'Staff', 'workingdays' => 'Working Days'));
echo jquery_tab_page_open('main');
?>
<table class='DataRow' cellpadding='0' cellspacing='0'>
<tr><th>Id:</th><td><?php
echo $row->id;
?>
</td></tr>
<tr><th>Name:</th><td><?php
echo form_input('name', quotes_to_entities($row->name), 'size="60"');
?>
</td></tr>
<tr><th>Code:</th><td><?php
echo form_input('code', quotes_to_entities($row->code), 'size="60"');
?>
</td></tr>
<tr><th>Street Number:</th><td><?php
echo form_input('street_number', $row->street_number, 'size="20"');
?>
</td></tr>
<tr><th>Street Name:</th><td><?php
echo form_input('street_name', $row->street_name, 'size="60"');
?>
</td></tr>
<tr><th>Unit Number:</th><td><?php
echo form_input('unit_number', $row->unit_number, 'size="20"');
?>
</td></tr>
<tr><th>City:</th><td><?php
示例14: form_textarea
?>
</td></tr>
<tr><th>Address:</th><td><?php
echo form_textarea('address', $row->address, 'cols="60"');
?>
</td></tr>
<tr><th>Send Birthday Greetings:</th><td><?php
echo form_checkbox('dob_alert', 'True', $row->dob_alert == 'True');
?>
</td></tr>
<tr><th>Call Preference:</th><td><?php
echo form_dropdown('call_type', $call_type_list, $row->call_type);
?>
</td></tr>
<tr><th>Call before shift:</th><td><?php
echo form_input('call_minutes', quotes_to_entities($row->call_minutes), 'size="10"');
?>
Minutes</td></tr>
<tr><th>Published:</th><td><?php
echo form_checkbox('is_published', 'True', $row->is_published == 'True');
?>
</td></tr>
<tr><th>Update Time:</th><td><?php
echo format_datetime($row->update_time);
?>
</td></tr>
</th></tr>
</table>
<?php
echo jquery_tab_page_close();
示例15: if
if(isset($albums))
{
?>
<div class="albums_block">
<?php
if(isset($pages)) echo $this->load->view('pagination_pages', $pages, TRUE);
foreach($albums as $ms)
{
?>
<div class="block">
<div class="img_block">
<?php
if(isset($ms['timage']))
{
?>
<a <?php if(isset($ms['detail_url'])) echo 'href="'.$ms['detail_url'].'"';?> class="img_href"><img src="<?=$ms['timage']?>" title="<?=quotes_to_entities($ms['image_title'])?>" alt="<?=quotes_to_entities($ms['image_alt'])?>"></a>
<?php
}
?>
</div>
<div class="name"><span><?=$ms['name']?></span></div>
<span class="description"><?=$ms['short_description']?></span>
<?php if(isset($ms['detail_url'])) echo '<div class="detail_link"><a href="'.$ms['detail_url'].'" ><span>'.$this->lang->line('base_detail_link_text').'</span></a></div>';?>
<div class="clear_both"></div>
</div>
<?
}
if(isset($pages)) echo $this->load->view('pagination_pages', $pages, TRUE);
?>
</div>
<?