当前位置: 首页>>代码示例>>PHP>>正文


PHP IsNullOrEmptyString函数代码示例

本文整理汇总了PHP中IsNullOrEmptyString函数的典型用法代码示例。如果您正苦于以下问题:PHP IsNullOrEmptyString函数的具体用法?PHP IsNullOrEmptyString怎么用?PHP IsNullOrEmptyString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了IsNullOrEmptyString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index()
 {
     $message_info = '';
     if (isset($_POST) && !empty($_POST)) {
         $name = $this->input->post('name');
         $email = $this->input->post('email');
         $phone = $this->input->post('phone');
         $subject = $this->input->post('subject');
         $message = $this->input->post('message');
         if (IsNullOrEmptyString($name) || IsNullOrEmptyString($email) || IsNullOrEmptyString($subject)) {
             $message_info = add_message_info($message_info, 'Name, Email & Subject cannot be empty.');
         } else {
             $this->form_validation->set_rules('email', 'E-mail', 'required|valid_email');
             if ($this->form_validation->run() == true) {
                 $email_data = array('name' => $name, 'email' => $email, 'phone' => $phone, 'subject' => $subject, 'message' => $message);
                 $this->session->set_flashdata('mail_info', $email_data);
                 redirect('contact_us/send_mail_process', 'refresh');
             } else {
                 $message_info = add_message_info($message_info, 'E-mail not valid. Please use a valid email.');
             }
         }
         $this->session->set_flashdata('message', $message_info);
     }
     $this->data['message'] = $this->session->flashdata('message');
     $this->data['page_path_name'] = 'page/contact_us';
     $this->load->view('template/layout', $this->data);
 }
开发者ID:ailuropodagit,项目名称:tttkkk,代码行数:27,代码来源:Contact_us.php

示例2: config

 function config()
 {
     $config = array('url' => 'http://127.0.0.1/ticket.tuagencia24.com/upload/api/tickets.json', 'key' => 'E9059472F7AC91544A453862B5D10C7B');
     if ($config['url'] === 'http://your.domain.tld/api/tickets.json') {
         echo "<p style=\"color:red;\"><b>Error: No URL</b><br>You have not configured this script with your URL!</p>";
         echo "Please edit this file " . __FILE__ . " and add your URL at line 18.</p>";
         die;
     }
     if (IsNullOrEmptyString($config['key']) || $config['key'] === 'PUTyourAPIkeyHERE') {
         echo "<p style=\"color:red;\"><b>Error: No API Key</b><br>You have not configured this script with an API Key!</p>";
         echo "<p>Please log into osticket as an admin and navigate to: Admin panel -> Manage -> Api Keys then add a new API Key.<br>";
         echo "Once you have your key edit this file " . __FILE__ . " and add the key at line 19.</p>";
         die;
     }
     return $config;
 }
开发者ID:jmangarret,项目名称:webtuagencia24,代码行数:16,代码来源:ost_api_old.php

示例3: isDate

function isDate($dateString)
{
    if (IsNullOrEmptyString($dateString)) {
        return FALSE;
    }
    if (!is_numeric(substr($dateString, 0, 1))) {
        return FALSE;
    }
    global $formats;
    foreach ($formats as $format) {
        $date = DateTime::createFromFormat($format, $dateString);
        if ($date == false) {
        } else {
            return TRUE;
        }
    }
    return FALSE;
}
开发者ID:tomasz-m,项目名称:realmGenerator,代码行数:18,代码来源:dateTest.php

示例4: getExternalDocId

function getExternalDocId($session)
{
    header("Cache-Control: no-cache, must-revalidate");
    //HTTP 1.1
    header("Pragma: no-cache");
    //HTTP 1.0
    header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
    // Date in the past
    $viewingSessionId = $session;
    // Call PCCIS
    // DocumentID query parameter already includes the "u" prefix so no need to add here
    $url = PccConfig::getImagingService() . "/ViewingSession/{$viewingSessionId}";
    $acsApiKey = PccConfig::getApiKey();
    $options = array('http' => array('method' => 'GET', 'header' => "Accept: application/json\r\n" . "Acs-Api-Key: {$acsApiKey}\r\n"));
    $context = stream_context_create($options);
    $result = file_get_contents($url, false, $context);
    $response = json_decode($result);
    if (IsNullOrEmptyString($response->origin->documentMarkupId)) {
        throw new Exception('It appears that the demo is not configured to use PCCIS. Please check the config values in "full-viewer-sample/viewer-webtier/pcc.conifg" and try again.');
    }
    return $response->origin->documentMarkupId;
}
开发者ID:Accusoft,项目名称:PCC-Viewer-PHP-Database-Demo,代码行数:22,代码来源:dbDemo.php

示例5: trans_config_set

 function trans_config_set($set_id, $update_value = NULL, $field_name = 'amount_change')
 {
     if (!IsNullOrEmptyString($update_value)) {
         $the_data = array($field_name => $update_value);
         if ($this->m_custom->compare_before_update('transaction_config', $the_data, 'trans_conf_id', $set_id)) {
             if ($this->ion_auth->logged_in()) {
                 $login_id = $this->ion_auth->user()->row()->id;
                 $the_data = array($field_name => $update_value, 'last_modify_by' => $login_id);
             }
             $this->db->where('trans_conf_id', $set_id);
             $this->db->update('transaction_config', $the_data);
         }
     }
 }
开发者ID:ailuropodagit,项目名称:tttkkk,代码行数:14,代码来源:M_admin.php

示例6: getNoticies

function getNoticies($dbParams, $lang)
{
    $dbhandle = getDBConnection($dbParams);
    if (IsNullOrEmptyString($lang)) {
        $result = mysql_query("SELECT no.title, fdb.body_value as body FROM node no, field_data_body fdb where no.type='noticia' and fdb.entity_id=no.nid order by no.created desc");
    } else {
        $result = mysql_query("SELECT no.title, fdb.body_value as body FROM node no, field_data_body fdb where no.type='noticia' and fdb.entity_id=no.nid and no.language='" . $lang . "' order by no.created desc");
    }
    mysql_close($dbhandle);
    return $result;
}
开发者ID:espixxl,项目名称:topguay,代码行数:11,代码来源:db_functions.php

示例7: form_open_multipart

<h1>Upload SSM</h1>
<br/>

<div id='register-form'>
    <?php 
echo form_open_multipart(uri_string());
?>
    
    Select File To Upload : <input type="file" name="userfile" multiple="multiple"  /><br/><br/>

    <button name="button_action" type="submit" value="upload_ssm" >Upload</button><br/><br/>

    <?php 
if (!IsNullOrEmptyString($me_ssm_file)) {
    ?>
        Current SSM File : <?php 
    echo $me_ssm_file;
    ?>
<br/><br/>

        <button name="button_action" type="submit" value="download_ssm" >Download</button><br/><br/>

    <?php 
}
echo form_close();
?>
</div>
开发者ID:ailuropodagit,项目名称:tttkkk,代码行数:27,代码来源:upload_ssm.php

示例8: displayTime

 function displayTime($time)
 {
     if (IsNullOrEmptyString($time)) {
         return '';
     }
     $ci =& get_instance();
     $return_time = date_create($time);
     return $return_time->format($ci->config->item('keppo_format_time_display'));
 }
开发者ID:ailuropodagit,项目名称:tttkkk,代码行数:9,代码来源:custom_helper.php

示例9: foreach

print "duplicateRecordCount     :" . $response->ExtCreateBroadcastResult->duplicateRecrodCountOnFile . "\n";
print "totalRecordCount         :" . $response->ExtCreateBroadcastResult->totalRecordCountOnFile . "\n";
*/
if (!IsNullOrEmptyString($response->ExtCreateBroadcastResult->fileUploadErrors->ExtFileUploadError)) {
    $isError = 1;
    /*
    foreach ($response->ExtCreateBroadcastResult->fileUploadErrors->ExtFileUploadError as $detail) {
     
            print "===================================== \n";
            print "Line Number      :" . $detail->lineNumber . "\n";
            print "errorCode        :" . $detail->errorCode . "\n";
            print "errorMessage     :" . $detail->errorMessage . "\n";
    }
    */
}
$x = 1;
while ($isError) {
    $response = $client->ExtCreateBroadcast(array("myRequest" => $request));
    if (!IsNullOrEmptyString($response->ExtCreateBroadcastResult->fileUploadErrors->ExtFileUploadError)) {
        $isError = 1;
        $x++;
    }
    if ($x == 3) {
        $isError = 0;
        $mail_for_error = mail('adamwalzer@gmail.com', 'Order Placed - Call Not', "Order ID: " . $order_id . "\n Restaurant: " . $rest_row['name'] . "\n Call-in-order: " . $PhoneNumbers, $headers_for_customer);
    }
}
function IsNullOrEmptyString($question)
{
    return !isset($question) || trim($question) === '';
}
开发者ID:adamwalzer,项目名称:code-samples,代码行数:31,代码来源:callinorder.php

示例10: catch

    {
        $this->status = $status;
        $this->message = $message;
    }
}
try {
    include "../dbopen.php";
} catch (Exception $e) {
    die("Error on db open " . $e->getMessage());
}
if (IsNullOrEmptyString($_POST['name'])) {
    $a = new RestResponse("error", "name is null");
    echo json_encode($a);
    exit(0);
}
if (IsNullOrEmptyString($_POST['nid'])) {
    $a = new RestResponse("error", "id is null");
    echo json_encode($a);
    exit(0);
}
$nid = $_POST['nid'];
$newCatName = $_POST['name'];
//Inserting Parent Category
$sql = "SELECT dpth, rgt, lft FROM nested_category WHERE CategoryId={$nid}";
$result = $conn->query($sql);
if ($result === null) {
    $a = new RestResponse("error", "Can not find the parent Category with id: " . $nid);
    echo json_encode($a);
    exit(0);
}
$row = $result->fetch_assoc();
开发者ID:BatboldS,项目名称:Zarnaa-mn,代码行数:31,代码来源:addChildCategory.php

示例11: base_url

            $image_path = $image_path_merchant_profile;
            $dashboard_url = "merchant_dashboard/{$slug}";
        }
        ?>
                <div id='follow-box'>
                    <div id="follow-box-photo">
                        <div id="follow-box-photo-box">
                            <a href='<?php 
        echo base_url();
        ?>
all/<?php 
        echo $dashboard_url;
        ?>
'>
                                <?php 
        if (IsNullOrEmptyString($profile_image)) {
            ?>
                                    <img src="<?php 
            echo base_url() . $empty_image;
            ?>
">
                                    <?php 
        } else {
            ?>
                                    <img src="<?php 
            echo base_url() . $image_path . $profile_image;
            ?>
">
                                    <?php 
        }
        ?>
开发者ID:ailuropodagit,项目名称:tttkkk,代码行数:31,代码来源:follow.php

示例12: get_merchant_today_hotdeal_removed

 public function get_merchant_today_hotdeal_removed($merchant_id, $date = NULL)
 {
     if (!IsNullOrEmptyString($date)) {
         $search_date = $date;
     } else {
         $search_date = date(format_date_server());
     }
     $this->db->where('hide_flag', 1);
     $condition = "start_time like '%" . $search_date . "%'";
     $this->db->where('advertise_type', 'hot');
     $this->db->where($condition);
     $query = $this->db->get_where('advertise', array('merchant_id' => $merchant_id));
     return $query->num_rows();
 }
开发者ID:ailuropodagit,项目名称:tttkkk,代码行数:14,代码来源:M_merchant.php

示例13: catch

<?php

try {
    include "../dbopen.php";
} catch (Exception $e) {
    die("Error on db open " . $e->getMessage());
}
$nid = 1;
if (isset($_POST['nid']) && !IsNullOrEmptyString($_POST['nid'])) {
    $nid = $_POST['nid'];
}
if ($nid == 1 || IsNullOrEmptyString($nid)) {
    echo "must provide category id!";
    exit(0);
}
function IsNullOrEmptyString($question)
{
    return !isset($question) || trim($question) === '';
}
$sql = "SELECT dpth, rgt, lft FROM nested_category WHERE CategoryId={$nid}";
$result = $conn->query($sql);
$row = $result->fetch_assoc();
if ($row === null) {
    exit;
}
$parentDpth = array_shift($row);
$parentRgt = array_shift($row);
$parentLft = array_shift($row);
//echo "parent dpth and rgt is: ".$parentDpth." and Rgt".$parentRgt."<br/>";
//actual deletion
$sql = "DELETE FROM nested_category WHERE lft >= {$parentLft} and rgt <= {$parentRgt}";
开发者ID:BatboldS,项目名称:Zarnaa-mn,代码行数:31,代码来源:deleteCategory.php

示例14: banner_change

 function banner_change($edit_id = NULL, $view_status = NULL)
 {
     if (!$this->m_admin->check_is_any_admin(69)) {
         redirect('/', 'refresh');
     }
     $message_info = '';
     $login_id = $this->login_id;
     $login_type = $this->login_type;
     $is_edit = 0;
     $main_table = 'banner';
     $main_table_id_column = 'banner_id';
     if ($edit_id != NULL) {
         $is_edit = 1;
     }
     if (isset($_POST) && !empty($_POST)) {
         $can_redirect_to = 0;
         //$edit_id = $this->input->post('edit_id');
         $merchant_id = $this->input->post('merchant_id');
         $banner_position_id = $this->input->post('banner_position_id');
         $banner_start_time = validateDate($this->input->post('banner_start_time'));
         $banner_end_time = validateDate($this->input->post('banner_end_time'));
         $banner_url = $this->input->post('banner_url');
         $banner_position = $this->m_custom->display_static_option($banner_position_id);
         $view_status = $this->input->post('view_status');
         $upload_rule = array('upload_path' => $this->album_banner, 'allowed_types' => $this->config->item('allowed_types_image'), 'max_size' => $this->config->item('max_size'), 'max_width' => $this->config->item('max_width'), 'max_height' => $this->config->item('max_height'));
         $this->load->library('upload', $upload_rule);
         $upload_file = "image-file-name";
         if ($edit_id == 0) {
             $is_edit = 0;
         } else {
             $is_edit = 1;
         }
         if ($this->input->post('button_action') == "save") {
             // validate form input
             $this->form_validation->set_rules('banner_position_id', $this->lang->line('banner_position'), 'callback_check_banner_position_id');
             $this->form_validation->set_rules('merchant_id', $this->lang->line('banner_merchant'));
             $this->form_validation->set_rules('banner_start_time', $this->lang->line('banner_start_time'), 'trim|required');
             $this->form_validation->set_rules('banner_end_time', $this->lang->line('banner_end_time'), 'trim|required');
             $this->form_validation->set_rules('banner_url', $this->lang->line('banner_url'), 'trim|required');
             if ($this->form_validation->run() === TRUE) {
                 if ($is_edit == 0) {
                     if (!empty($_FILES[$upload_file]['name'])) {
                         if (!$this->upload->do_upload($upload_file)) {
                             $message_info = add_message_info($message_info, $this->upload->display_errors());
                         } else {
                             $image_data = array('upload_data' => $this->upload->data());
                         }
                     }
                     $banner_image = empty($image_data) ? '' : $image_data['upload_data']['file_name'];
                     $new_id = $this->m_admin->banner_insert($merchant_id, NULL, $banner_start_time, $banner_end_time, $banner_image, $banner_url, $banner_position_id);
                     if ($new_id) {
                         $message_info = add_message_info($message_info, 'Success create a banner on this banner position ' . $banner_position);
                         $edit_id = $new_id;
                         $can_redirect_to = 2;
                     } else {
                         $message_info = add_message_info($message_info, 'Fail to create banner on this banner position ' . $banner_position . ' because it still have another banner occupy, please select an empty banner position');
                         $can_redirect_to = 1;
                     }
                 } else {
                     $result_update = $this->m_custom->get_one_table_record($main_table, $main_table_id_column, $edit_id, 1);
                     $previous_image_name = $result_update['banner_image'];
                     if (!empty($_FILES[$upload_file]['name'])) {
                         if (!$this->upload->do_upload($upload_file)) {
                             $message_info = add_message_info($message_info, $this->upload->display_errors());
                         } else {
                             $image_data = array('upload_data' => $this->upload->data());
                             if (!IsNullOrEmptyString($previous_image_name)) {
                                 delete_file($this->album_banner . $previous_image_name);
                             }
                         }
                     }
                     $banner_image = empty($image_data) ? $previous_image_name : $image_data['upload_data']['file_name'];
                     if ($this->m_admin->banner_update($merchant_id, NULL, $banner_start_time, $banner_end_time, $banner_image, $banner_url, $banner_position_id, $edit_id, $result_update['hide_flag'])) {
                         $message_info = add_message_info($message_info, 'Success update the banner on banner position ' . $banner_position);
                         $can_redirect_to = 2;
                     } else {
                         $message_info = add_message_info($message_info, 'Fail to update banner on this banner position ' . $banner_position . ' because it still have another banner occupy, please select an empty banner position');
                         $can_redirect_to = 3;
                     }
                 }
                 $this->m_custom->remove_image_temp();
             }
         }
         if ($this->input->post('button_action') == "back") {
             $can_redirect_to = 2;
         }
         if ($this->input->post('button_action') == "frozen") {
             $message_info = add_message_info($message_info, $banner_position . ' success hide.');
             $this->m_custom->update_hide_flag(1, $main_table, $edit_id, $login_id);
         }
         if ($this->input->post('button_action') == "recover") {
             $status = $this->m_admin->banner_recover($edit_id);
             if ($status) {
                 $message_info = add_message_info($message_info, $banner_position . ' success recover.');
             } else {
                 $message_info = add_message_info($message_info, $banner_position . ' fail to recover. Because already have other active banner in the same banner position');
             }
         }
         direct_go:
         if ($message_info != NULL) {
//.........这里部分代码省略.........
开发者ID:ailuropodagit,项目名称:tttkkk,代码行数:101,代码来源:Admin.php

示例15: home_search_promotion

 public function home_search_promotion($search_value = NULL, $state_id = 0)
 {
     if (!IsNullOrEmptyString($search_value)) {
         $merchant_list_id = $this->m_merchant->searchMerchant($search_value, 1);
         $search_word = $this->db->escape('%' . $search_value . '%');
         if (!empty($merchant_list_id)) {
             $merchant_string = implode(',', $merchant_list_id);
             $this->db->where("((`title` LIKE {$search_word} OR `description` LIKE {$search_word}) OR `merchant_id` IN ({$merchant_string}))");
         } else {
             $this->db->where("(`title` LIKE {$search_word} OR `description` LIKE {$search_word})");
         }
     }
     $this->db->where('end_time >=', get_part_of_date('all'));
     $this->db->where('start_time is not null AND end_time is not null');
     $this->db->order_by("advertise_id", "desc");
     $query = $this->db->get_where('advertise', array('advertise_type' => 'pro', 'hide_flag' => 0));
     $result = $query->result_array();
     $return = array();
     foreach ($result as $row) {
         $advertise_id = $row['advertise_id'];
         if ($state_id != 0) {
             $branch_list = $this->m_custom->many_get_childlist('candie_branch', $advertise_id, 1);
             foreach ($branch_list as $branch) {
                 $branch_query = $this->db->get_where('merchant_branch', array('branch_id' => $branch['many_child_id']))->row_array();
                 if ($state_id == $branch_query['state_id']) {
                     $return[] = $row;
                 }
             }
             $return = array_unique($return, SORT_REGULAR);
         } else {
             $return[] = $row;
         }
     }
     return $return;
 }
开发者ID:ailuropodagit,项目名称:tttkkk,代码行数:35,代码来源:M_custom.php


注:本文中的IsNullOrEmptyString函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。