本文整理汇总了PHP中str_ireplace函数的典型用法代码示例。如果您正苦于以下问题:PHP str_ireplace函数的具体用法?PHP str_ireplace怎么用?PHP str_ireplace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了str_ireplace函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: pic_cutOp
/**
* 图片裁剪
*
*/
public function pic_cutOp()
{
Uk86Language::uk86_read('admin_common');
$lang = Uk86Language::uk86_getLangContent();
uk86_import('function.thumb');
if (uk86_chksubmit()) {
$thumb_width = $_POST['x'];
$x1 = $_POST["x1"];
$y1 = $_POST["y1"];
$x2 = $_POST["x2"];
$y2 = $_POST["y2"];
$w = $_POST["w"];
$h = $_POST["h"];
$scale = $thumb_width / $w;
$src = str_ireplace(UPLOAD_SITE_URL, BASE_UPLOAD_PATH, $_POST['url']);
if (strpos($src, '..') !== false || strpos($src, BASE_UPLOAD_PATH) !== 0) {
exit;
}
if (!empty($_POST['filename'])) {
// $save_file2 = BASE_UPLOAD_PATH.'/'.$_POST['filename'];
$save_file2 = str_ireplace(UPLOAD_SITE_URL, BASE_UPLOAD_PATH, $_POST['filename']);
} else {
$save_file2 = str_replace('_small.', '_sm.', $src);
}
$cropped = uk86_resize_thumb($save_file2, $src, $w, $h, $x1, $y1, $scale);
@unlink($src);
$pathinfo = pathinfo($save_file2);
exit($pathinfo['basename']);
}
$save_file = str_ireplace(UPLOAD_SITE_URL, BASE_UPLOAD_PATH, $_GET['url']);
$_GET['resize'] = $_GET['resize'] == '0' ? '0' : '1';
Tpl::output('height', uk86_get_height($save_file));
Tpl::output('width', uk86_get_width($save_file));
Tpl::showpage('common.pic_cut', 'null_layout');
}
开发者ID:wangjiang988,项目名称:ukshop,代码行数:39,代码来源:common.php
示例2: singleParamHtmlHolder
public function singleParamHtmlHolder($param, $value)
{
$output = '';
// Compatibility fixes
$old_names = array('yellow_message', 'blue_message', 'green_message', 'button_green', 'button_grey', 'button_yellow', 'button_blue', 'button_red', 'button_orange');
$new_names = array('alert-block', 'alert-info', 'alert-success', 'btn-success', 'btn', 'btn-info', 'btn-primary', 'btn-danger', 'btn-warning');
$value = str_ireplace($old_names, $new_names, $value);
//$value = __($value, LANGUAGE_ZONE);
//
$param_name = isset($param['param_name']) ? $param['param_name'] : '';
$type = isset($param['type']) ? $param['type'] : '';
$class = isset($param['class']) ? $param['class'] : '';
if (isset($param['holder']) == true && $param['holder'] !== 'hidden') {
$output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
}
if ($param_name == 'images') {
$images_ids = empty($value) ? array() : explode(',', trim($value));
$output .= '<ul class="attachment-thumbnails' . (empty($images_ids) ? ' image-exists' : '') . '" data-name="' . $param_name . '">';
foreach ($images_ids as $image) {
$img = wpb_getImageBySize(array('attach_id' => (int) $image, 'thumb_size' => 'thumbnail'));
$output .= $img ? '<li>' . $img['thumbnail'] . '</li>' : '<li><img width="150" height="150" test="' . $image . '" src="' . WPBakeryVisualComposer::getInstance()->assetURL('vc/blank.gif') . '" class="attachment-thumbnail" alt="" title="" /></li>';
}
$output .= '</ul>';
$output .= '<a href="#" class="column_edit_trigger' . (!empty($images_ids) ? ' image-exists' : '') . '">' . __('Add images', LANGUAGE_ZONE) . '</a>';
}
return $output;
}
开发者ID:scottnkerr,项目名称:eeco,代码行数:27,代码来源:image_gallery.php
示例3: StripTags
function StripTags($out)
{
$out = strip_tags($out);
$out = trim(preg_replace("~[\\s]+~", " ", $out));
$out = str_ireplace("…", "", $out);
return $out;
}
开发者ID:superego546,项目名称:SMSGyan,代码行数:7,代码来源:KE_gossip.php
示例4: getLink
public static function getLink($params, $fields = array('simple', 'menu', 'article'), $content_item = false, $isJoomlaArticle = true)
{
$simple = $fields[0];
$menu = $fields[1];
$article = $fields[2];
$link = '';
if ($params->get($simple, '') != '') {
$link = str_ireplace('{SITE}/', JURI::root(), $params->get($simple));
} elseif ($params->get($menu, '') != '') {
$application = JFactory::getApplication();
$cms_menu = $application->getMenu();
$menu_item = $cms_menu->getItem($params->get($menu));
$link = JRoute::_($menu_item->link . '&Itemid=' . $menu_item->id);
} elseif ($params->get($article, '') != '') {
if (self::getjVersion() > 2) {
$link = JRoute::_('index.php?option=com_content&view=article&id=' . $params->get($article, ''));
} else {
$link = JRoute::_(ContentHelperRoute::getArticleRoute($params->get($article, '')));
}
} elseif ($content_item && $isJoomlaArticle) {
if (self::getjVersion() > 2) {
$link = JRoute::_('index.php?option=com_content&view=article&id=' . $content_item->id);
} else {
$link = JRoute::_(ContentHelperRoute::getArticleRoute($content_item->id, $content_item->catid));
}
} elseif ($content_item) {
if (@isset($content_item->link)) {
$link = $content_item->link;
}
}
return $link;
}
开发者ID:VierlingMt,项目名称:joomla-3.x,代码行数:32,代码来源:helper.php
示例5: removeAttribute
/**
* Removes unwanted attributes from a particular tag
*
* @param string $fullTag (e.g. '<a onclick="alert('XSS');">')
* @param string $attributes (e.g. 'a onclick="alert('XSS');"')
* @return string
*/
protected function removeAttribute($fullTag, $attributes)
{
$replacement = $this->attributeFinder->findAttributes($attributes, function () {
return '';
});
return str_ireplace($attributes, $replacement, $fullTag);
}
开发者ID:phlib,项目名称:xss-sanitizer,代码行数:14,代码来源:RemoveAttributes.php
示例6: talk
function talk($content, $name, $api, $apikey = '')
{
$content = str_ireplace("@{$name}", '', $content);
$content = str_ireplace("回复 {$name} :", '', $content);
$content = urlencode($content);
switch ($api) {
case 'xiaoji':
$re = xiaoji($content);
break;
case 'xiaoi3':
$re = xiaoi3($content);
break;
case 'tuling':
$re = tuling($content, $apikey);
break;
case 'simsimi3':
$re = simsimi3($content);
break;
case 'simsimi':
$re = simsimi($content);
break;
default:
$re = xiaoji($content);
}
return $re;
}
开发者ID:WingLim,项目名称:TieBaRobot,代码行数:26,代码来源:api.php
示例7: parse
/**
* Parses an URI string returning an array of connection parameters.
*
* When using the "redis" and "rediss" schemes the URI is parsed according
* to the rules defined by the provisional registration documents approved
* by IANA. If the URI has a password in its "user-information" part or a
* database number in the "path" part these values override the values of
* "password" and "database" if they are present in the "query" part.
*
* @link http://www.iana.org/assignments/uri-schemes/prov/redis
* @link http://www.iana.org/assignments/uri-schemes/prov/redis
*
* @param string $uri URI string.
*
* @throws \InvalidArgumentException
*
* @return array
*/
public static function parse($uri)
{
if (stripos($uri, 'unix') === 0) {
// Hack to support URIs for UNIX sockets with minimal effort.
$uri = str_ireplace('unix:///', 'unix://localhost/', $uri);
}
if (!($parsed = parse_url($uri))) {
throw new \InvalidArgumentException("Invalid parameters URI: {$uri}");
}
if (isset($parsed['host']) && false !== strpos($parsed['host'], '[') && false !== strpos($parsed['host'], ']')) {
$parsed['host'] = substr($parsed['host'], 1, -1);
}
if (isset($parsed['query'])) {
parse_str($parsed['query'], $queryarray);
unset($parsed['query']);
$parsed = array_merge($parsed, $queryarray);
}
if (stripos($uri, 'redis') === 0) {
if (isset($parsed['pass'])) {
$parsed['password'] = $parsed['pass'];
unset($parsed['pass']);
}
if (isset($parsed['path']) && preg_match('/^\\/(\\d+)(\\/.*)?/', $parsed['path'], $path)) {
$parsed['database'] = $path[1];
if (isset($path[2])) {
$parsed['path'] = $path[2];
} else {
unset($parsed['path']);
}
}
}
return $parsed;
}
开发者ID:sabbana,项目名称:studio_apps,代码行数:51,代码来源:Parameters.php
示例8: installPaExtension
public function installPaExtension()
{
$this->model = $this->getModel('installer');
JSNFactory::import('components.com_installer.helpers.installer');
$canDo = InstallerHelper::getActions();
if ($canDo->get('core.manage')) {
try {
$rs = $this->model->download();
$this->input->set('package', $rs);
// Set extension parameters
$_GET['package'] = $rs;
$_GET['type'] = 'plugin';
$_GET['folder'] = 'jsnpoweradmin';
$_GET['publish'] = 1;
$_GET['client'] = 'site';
$_GET['name'] = str_ireplace(JSN_POWERADMIN_EXT_IDENTIFIED_NAME_PREFIX, '', $_GET['identified_name']);
$this->model->install($rs);
if ($this->model->install($rs)) {
require_once JPATH_COMPONENT_ADMINISTRATOR . '/helpers/extensions.php';
// Enable extension suport
$_GET['name'] = str_ireplace(JSN_POWERADMIN_EXT_IDENTIFIED_NAME_PREFIX, '', $_GET['identified_name']);
try {
JSNPaExtensionsHelper::enableExt($identifiedName);
} catch (Exception $ex) {
exit('notenabled');
}
}
} catch (Exception $ex) {
exit($ex->getMessage());
}
exit('success');
}
}
开发者ID:NallelyFlores89,项目名称:basvec,代码行数:33,代码来源:installer.php
示例9: singleParamHtmlHolder
public function singleParamHtmlHolder($param, $value)
{
$output = '';
// Compatibility fixes
$old_names = array('yellow_message', 'blue_message', 'green_message', 'button_green', 'button_grey', 'button_yellow', 'button_blue', 'button_red', 'button_orange');
$new_names = array('alert-block', 'alert-info', 'alert-success', 'btn-success', 'btn', 'btn-info', 'btn-primary', 'btn-danger', 'btn-warning');
$value = str_ireplace($old_names, $new_names, $value);
$param_name = isset($param['param_name']) ? $param['param_name'] : '';
$type = isset($param['type']) ? $param['type'] : '';
$class = isset($param['class']) ? $param['class'] : '';
if ('attach_image' === $param['type'] && 'image' === $param_name) {
$output .= '<input type="hidden" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '" />';
$element_icon = $this->settings('icon');
$img = wpb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail'));
$this->setSettings('logo', ($img ? $img['thumbnail'] : '<img width="150" height="150" src="' . vc_asset_url('vc/blank.gif') . '" class="attachment-thumbnail vc_element-icon" data-name="' . $param_name . '" alt="" title="" style="display: none;" />') . '<span class="no_image_image vc_element-icon' . (!empty($element_icon) ? ' ' . $element_icon : '') . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '" /><a href="#" class="column_edit_trigger' . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '">' . __('Add image', 'js_composer') . '</a>');
$output .= $this->outputTitleTrue($this->settings['name']);
} elseif (!empty($param['holder'])) {
if ($param['holder'] === 'input') {
$output .= '<' . $param['holder'] . ' readonly="true" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '">';
} elseif (in_array($param['holder'], array('img', 'iframe'))) {
$output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" src="' . $value . '">';
} elseif ($param['holder'] !== 'hidden') {
$output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
}
}
if (!empty($param['admin_label']) && $param['admin_label'] === true) {
$output .= '<span class="vc_admin_label admin_label_' . $param['param_name'] . (empty($value) ? ' hidden-label' : '') . '"><label>' . $param['heading'] . '</label>: ' . $value . '</span>';
}
return $output;
}
开发者ID:VitaAprel,项目名称:mynotebook,代码行数:30,代码来源:vc-single-image.php
示例10: basePathLib
function basePathLib($relative_path)
{
$scriptName = str_replace('/class/image.class.php', '', $_SERVER['SCRIPT_NAME']);
$realpath = str_replace('\\', '/', realpath($relative_path));
$htmlpath = str_ireplace(str_replace('\\', '/', ROOT_DIR), '', $realpath);
return $htmlpath;
}
开发者ID:strangerandy,项目名称:raid,代码行数:7,代码来源:image.class.php
示例11: load
/**
* Autoloader load method. Load the class.
*
* @param $class_name
*/
public function load($class_name)
{
// Only load DLM
if (0 === strpos($class_name, 'DLM_')) {
// String to lower
$class_name = strtolower($class_name);
// Format file name
$file_name = 'class-' . str_ireplace('_', '-', str_ireplace('DLM_', 'dlm-', $class_name)) . '.php';
// Setup the file path
$file_path = $this->path;
// Check if we need to extend the class path
if (strpos($class_name, 'dlm_admin') === 0) {
$file_path .= 'admin/';
} else {
if (strpos($class_name, 'dlm_widget') === 0) {
$file_path .= 'widgets/';
} else {
if (strpos($class_name, 'dlm_product') === 0) {
$file_path .= 'product/';
}
}
}
// Append file name to clas path
$file_path .= $file_name;
// Check & load file
if (file_exists($file_path)) {
require_once $file_path;
}
}
}
开发者ID:garysims,项目名称:bbmp3downloader,代码行数:35,代码来源:class-dlm-autoloader.php
示例12: createFolder
/**
* Create missing folders
*
* @copyright
* @author RolandD
* @todo
* @see
* @access public
* @param
* @return
* @since 3.0
*/
public function createFolder()
{
$app = JFactory::getApplication();
jimport('joomla.filesystem.folder');
$folder = str_ireplace(JPATH_ROOT, '', JRequest::getVar('folder'));
return JFolder::create($folder);
}
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:19,代码来源:about.php
示例13: migrate_authors
function migrate_authors($string)
{
$result = '';
$array = array();
$new_authors = array();
$string = str_ireplace(' and ', ' , ', $string);
$string = str_ireplace(', and ', ' , ', $string);
$string = str_ireplace(',and ', ' , ', $string);
$string = str_ireplace(';', ',', $string);
$array = explode(',', $string);
$array = array_filter($array);
if (!empty($array)) {
foreach ($array as $author) {
$author = trim($author);
$author = str_replace('"', '', $author);
$space = strpos($author, ' ');
if ($space === false) {
$last = trim($author);
$first = '';
} else {
$last = trim(substr($author, 0, $space));
$first = trim(substr($author, $space + 1));
}
if (!empty($last)) {
$new_authors[] = 'L:"' . $last . '",F:"' . $first . '"';
}
}
if (count($new_authors) > 0) {
$result = join(';', $new_authors);
}
}
return $result;
}
开发者ID:fweik,项目名称:i-librarian,代码行数:33,代码来源:migrate4.php
示例14: wpui_slide_shortcode
function wpui_slide_shortcode($atts, $content = null)
{
extract(shortcode_atts(array('image' => false, 'image_title' => false), $atts));
if ($image_title) {
$imagea = wpui_get_media_item($image_title);
}
$image = $imagea['image'];
if (!$image || !function_exists('getimagesize')) {
return false;
}
if (is_array($imagea)) {
$img_title = $imagea['title'];
} else {
$filename = substr(strrchr($image, '/'), 1);
$filename = str_ireplace(strrchr($filename, '.'), '', $filename);
$img_title = $filename;
}
$samp = getimagesize($image);
if (!is_array($samp)) {
return "Not a valid image.";
}
$output = '';
$output .= '<h3 class="wp-tab-title">' . $imagea['title'] . '</h3>';
$output .= '<div class="wpui-slide wp-tab-content">';
$output .= '<img src="' . $image . '" />';
$output .= '<div class="wpui_image_description">' . $content . '</div>';
$output .= '</div><!-- end .wpui-slide -->';
return $output;
}
开发者ID:Blueprint-Marketing,项目名称:interoccupy.net,代码行数:29,代码来源:wpui-slides.php
示例15: __construct
/**
*
* @param Mongostar_Model_Interface $model
* @param string $foreign_class_name
* @param array $options
* @param string $property_name
*/
public function __construct(Mongostar_Model_Interface $model, $foreign_class_name, array $options, $property_name)
{
$this->_foreign_class_name = $foreign_class_name;
$this->set_relation_name($property_name);
$this->_local_class_name = get_class($model);
if (isset($options['foreignKey'])) {
$this->_foreign_key = $options['foreignKey'];
} else {
$this->_foreign_key = $property_name . '_id';
}
if (isset($options['foreignSort'])) {
$sort_key = $options['foreignSort'];
$sort_dir = 1;
if (strpos(':', $sort_key)) {
$sort_key = explode(':', $sort_key);
$sort_dir = $sort_key[1];
$sort_key = $sort_key[0];
$sort_dir = (int) str_ireplace(array('asc', 'desc'), array(0, 1), $sort_dir);
}
$this->_foreign_sort[$sort_key] = $sort_dir;
}
if (isset($options['localKey'])) {
$this->_local_key = $options['localKey'];
} else {
$this->_localKey = 'id';
}
}
开发者ID:execrot,项目名称:mongostar,代码行数:34,代码来源:HasMany.php
示例16: getParsedText
public function getParsedText($params = [])
{
$match = null;
$text = $this->text;
if (preg_match_all('/{{page:([\\w-]+)}}/i', $text, $match)) {
foreach ($match[0] as $key => $value) {
$page = Page::get($match[1][$key]);
if ($page) {
$content = $page->parsedText;
} else {
$content = '';
}
$text = str_ireplace($value, $content, $text);
}
}
if (preg_match_all('/{{setting:([\\w-]+)}}/i', $text, $match)) {
foreach ($match[0] as $key => $value) {
$content = Setting::get($match[1][$key]);
$text = str_ireplace($value, $content, $text);
}
}
if (preg_match_all('/{{var:([\\w-]+)}}/i', $text, $match)) {
foreach ($match[0] as $key => $value) {
if (isset($params[$match[1][$key]])) {
$text = str_ireplace($value, $params[$match[1][$key]], $text);
}
}
}
return $text;
}
开发者ID:nanodesu88,项目名称:easyii,代码行数:30,代码来源:PageObject.php
示例17: renderQuran
function renderQuran()
{
// html url to the application
$api_url = 'http://GlobalQuran.com/';
$api_key = get_option('gq_key');
################## DO NOT EDIT BELOW THIS ###################################
if (!$api_url) {
die('missing vaules, please fill the configuration values and try again!');
}
$_REQUEST['apiKey'] = $api_key;
$urlstring = NULL;
build_string($_REQUEST, $urlstring);
$ch = curl_init($api_url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $urlstring);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($ch);
curl_close($ch);
$html = str_ireplace('<!DOCTYPE html>', '', strip_only($data, 'head', true));
$html = str_ireplace('<html lang="en" dir="lrt">', '', $html);
$html = str_ireplace('<body class="ltr ">', '', $html);
$html = str_ireplace('<body class="ltr ">', '', $html);
$html = str_ireplace('</body>', '', $html);
$html = str_ireplace('</html>', '', $html);
$head = '<link rel="shortcut icon" href="http://GlobalQuran.com/favicon.ico" />
<link rel="stylesheet" href="' . get_option('gq_css_url') . '" media="screen,print" />
<link rel="stylesheet" href="' . get_option('gq_css_print_url') . '" media="print" />';
return $head . $html;
}
开发者ID:ATouhou,项目名称:lab,代码行数:31,代码来源:globalquran.php
示例18: fixPContent
public function fixPContent($content = null)
{
$s = array("<p><div class=\"row-fluid\"", "</div></p>");
$r = array("<div class=\"row-fluid\"", "</div>");
$content = str_ireplace($s, $r, $content);
return $content;
}
开发者ID:roycocup,项目名称:enclothed,代码行数:7,代码来源:build.php
示例19: email
function email($contas)
{
global $CONFIG_smtp_server, $CONFIG_smtp_port, $CONFIG_smtp_username, $CONFIG_smtp_password, $CONFIG_smtp_mail, $CONFIG_name;
$mensagem = "----------------------------\n";
for ($i = 0; isset($contas[$i][0]); $i++) {
$mensagem .= "Username: " . $contas[$i][0];
$mensagem .= "\nPassword: " . $contas[$i][1];
$mensagem .= "\n----------------------------\n";
}
$maildef = read_maildef("recover_password");
$maildef = str_ireplace("#account_info#", $mensagem, $maildef);
$maildef = str_ireplace("#server_name#", $CONFIG_name, $maildef);
$maildef = str_ireplace("#support_mail#", $CONFIG_smtp_mail, $maildef);
$maildef = nl2br($maildef);
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->Host = $CONFIG_smtp_server;
$mail->Port = $CONFIG_smtp_port;
$mail->Username = $CONFIG_smtp_username;
$mail->Password = $CONFIG_smtp_password;
$mail->From = $CONFIG_smtp_mail;
$mail->FromName = $CONFIG_name;
$mail->Subject = "Password Recovery";
$mail->Body = $maildef;
$mail->WordWrap = 50;
$mail->AddAddress($contas[0][2], $contas[0][2]);
$mail->AddReplyTo($CONFIG_smtp_mail, $CONFIG_name);
$mail->IsHTML(true);
if (!$mail->Send()) {
return $mail->ErrorInfo;
} else {
return "Message has been sent";
}
}
开发者ID:brenoinojosa,项目名称:ragnarok-public,代码行数:35,代码来源:mail.php
示例20: export
function export()
{
$model = M("Customer");
$where['is_del'] = 0;
$list = $model->where($where)->select();
Vendor('Excel.PHPExcel');
//导入thinkphp第三方类库
$inputFileName = "Public/templete/customer.xlsx";
$objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
$objPHPExcel->getProperties()->setCreator("smeoa")->setLastModifiedBy("smeoa")->setTitle("Office 2007 XLSX Test Document")->setSubject("Office 2007 XLSX Test Document")->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")->setKeywords("office 2007 openxml php")->setCategory("Test result file");
// Add some data
$i = 1;
//dump($list);
foreach ($list as $val) {
$i++;
$objPHPExcel->setActiveSheetIndex(0)->setCellValue("A{$i}", $val["name"])->setCellValue("B{$i}", $val["short"])->setCellValue("C{$i}", $val["biz_license"])->setCellValue("D{$i}", $val["payment"])->setCellValue("E{$i}", $val["address"])->setCellValue("F{$i}", $val["salesman"])->setCellValue("G{$i}", $val["contact"])->setCellValue("H{$i}", $val["email"])->setCellValue("I{$i}", $val["office_tel"])->setCellValue("J{$i}", $val["mobile_tel"])->setCellValue("J{$i}", $val["fax"])->setCellValue("L{$i}", $val["im"])->setCellValue("M{$i}", $val["remark"]);
}
// Rename worksheet
$objPHPExcel->getActiveSheet()->setTitle('Customer');
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
$objPHPExcel->setActiveSheetIndex(0);
$file_name = "customer.xlsx";
// Redirect output to a client’s web browser (Excel2007)
header("Content-Type: application/force-download");
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header("Content-Disposition:attachment;filename =" . str_ireplace('+', '%20', URLEncode($file_name)));
header('Cache-Control: max-age=0');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save('php://output');
exit;
}
开发者ID:2ger,项目名称:trunk,代码行数:31,代码来源:CustomerAction.class.php
注:本文中的str_ireplace函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论