 |
|
|
 |
 |
|
พี่คะ ผลลัพธืที่ได้เป็นแบบนี้อ่ะคะ Array ( )
ต้องแก้ไขโค้ดยังไงคะ เขียนโค้ดแบบนี้คะ รบกวนด้วยนะคะ
Code (PHP)
<?
$arr1 = null;
$strFileName = "C:/AppServ/www/swathf/outputnews.txt";
$objFopen = fopen($strFileName, 'r');
if ($objFopen) {
while (!feof($objFopen)) {
$file = fgets($objFopen, 4096);
$arr1[] = $file;
}
fclose($objFopen);
}
$dataArray = array();
$path = "C:/AppServ/www/orchid";
$strFileName = "orchid97.crp.utf";
$objFopen = fopen($path."/".$strFileName,"r");
if ($objFopen) {
while (!feof($objFopen)) {
$file = fgets($objFopen, 4096);
if(strrpos($file, "NCMN") > 0) {
$arr = split("/",$file);
array_push( $dataArray, $arr[0]."<br>" );
}
}
fclose($objFopen);
$uniqueArray = array_unique( $dataArray );
foreach($uniqueArray as $each_name){
// print "$each_name"; }
}}
$result = array_intersect($arr1, $dataArray);
print_r($result);
?>
|
 |
 |
 |
 |
Date :
2012-03-10 14:46:48 |
By :
madam |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผลลัพธ์ได้แบบนี้คะ Array ( )
แสดงว่าไม่มีคำที่ซ้ำกันรึเปล่าคะ ทั้ง ๆ ที่ทั้งสองไฟล์มีคำที่ซ้ำกันอยู่คะ ต้องแก้ไขยังไงคะ รบกวนช่วยดูหน่อยนะคะ 
|
 |
 |
 |
 |
Date :
2012-03-11 15:05:24 |
By :
madam |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ประมาณนั้นครับ
|
 |
 |
 |
 |
Date :
2012-03-12 06:27:42 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
พี่คะ ถ้ามันขึ้น error แบบนี้ ต้องแก้ไขยังไงคะ
Fatal error: Allowed memory size of 25165824 bytes exhausted (tried to allocate 4097 bytes) in C:\AppServ\www\compare.php on line 19
|
 |
 |
 |
 |
Date :
2012-03-12 17:05:19 |
By :
madam |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|