本文整理汇总了PHP中Spreadsheet_Excel_Reader::format方法的典型用法代码示例。如果您正苦于以下问题:PHP Spreadsheet_Excel_Reader::format方法的具体用法?PHP Spreadsheet_Excel_Reader::format怎么用?PHP Spreadsheet_Excel_Reader::format使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spreadsheet_Excel_Reader
的用法示例。
在下文中一共展示了Spreadsheet_Excel_Reader::format方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: die
<?php
ini_set("memory_limit", "10000M");
$conn = mysql_connect("localhost", "jsmdevcons", "Jsmd1234") or die("Couldn't connect to server.");
$db = mysql_select_db("test", $conn) or die("Couldn't select database.");
ini_set("display_errors", 1);
error_reporting(E_ALL);
require_once 'excel/excel_reader2.php';
$data = new Spreadsheet_Excel_Reader("StkCSum.xls");
$unit_master = array();
for ($row = 5; $row <= $data->rowcount(); $row++) {
if ($data->format($row, 3) != "") {
$arr_test = explode(" ", $data->format($row, 3));
$uom = str_replace('"', "", $arr_test[1]);
if (!in_array($uom, $unit_master)) {
$unit_master[] = $uom;
}
}
}
foreach ($unit_master as $unit_name) {
$sql_unit_master = "insert into ms_uom set\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname = '" . $unit_name . "'";
$result_ins = mysql_query($sql_unit_master) or die("Error in query:" . $sql_unit_master . "<br>" . mysql_error() . ":" . mysql_errno());
}
$dep_id = 0;
for ($row = 5; $row <= $data->rowcount(); $row++) {
if ($data->bold($row, 1, 0)) {
$sql_department = "insert into ms_department set\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tname = '" . $data->value($row, 1, 0) . "'";
$result_ins = mysql_query($sql_department) or die("Error in query:" . $sql_department . "<br>" . mysql_error() . ":" . mysql_errno());
$dep_id = mysql_insert_id();
} else {
$unit_id = 0;
示例2:
<br><br>
<table border="1">
<?php
for ($row = 1; $row <= $xls->rowcount(); $row++) {
?>
<tr>
<?php
for ($col = 1; $col <= $xls->colcount(); $col++) {
?>
<td><?php
echo $xls->val($row, $col);
?>
<div><br>Format=<?php
echo $xls->format($row, $col);
?>
<br>FormatIndex=<?php
echo $xls->formatIndex($row, $col);
?>
<br>Raw=<?php
echo $xls->raw($row, $col);
?>
</div></td>
<?php
}
?>
</tr>
<?php
}
?>