сеть — добавление сетевой папки в переполнение стека

У меня есть этот код, который берет файлы из $ sDirectory и открывает каждый из них, затем читает каждую строку TXT и, если он содержит $ Word в каждой строке, он копирует файл в $ NewDirectory и $ NewDirectory2, мой вопрос: Как я могу назначить один из новых каталогов сетевой папкой? f.e «\\ 10.55.33.14 \ Папка».

Вот код:

<?php
$sDirectory     = 'C:\Users\ramosala\Desktop\New folder (2)';
$sNewDirectory  = 'C:\Users\ramosala\Documents\Prueba Coppel 2';
$sNewDirectory2 = 'C:\Users\ramosala\Documents\Prueba Coppel';
$Word="/\b(rfc        = COP-920428Q20)\b/i";
if( !is_dir( $sNewDirectory ) )
{
mkdir( $sNewDirectory, 0777, TRUE );
}
if( !is_dir( $sNewDirectory2 ) )
{
mkdir( $sNewDirectory2, 0777, TRUE );
}
$sFilter = '12';
if( is_dir( $sDirectory ) )
{
$rDir = opendir( $sDirectory );
while( ( $sFile = readdir( $rDir ) ) !== FALSE )
{
if( ( $sFile == '.' ) || ( $sFile === '..' ) )
{
continue;
}
$sFilePath = $sDirectory . '/' . $sFile;
$sContents = file_get_contents( $sFilePath );
$Line = $sContents;
if (preg_match($Word,$Line)){
if( strpos( $sContents, $sFilter ) !== FALSE )
{
$sNewFileName  = $sNewDirectory . '/' . $sFile;
$sNewFileName2 = $sNewDirectory2 . '/' . $sFile;
if( !copy( $sFilePath, $sNewFileName ) || !copy( $sFilePath, $sNewFileName2 ) )
{
echo 'Could not move: ' . $sFile;
}
else
{
unlink( $sFilePath );
}
}
}
}
}
?>

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector