2016-12-07 1 views
0

Благодарим за помощь. Я работаю над новым сайтом, мне бы хотелось создать CSV с XML-сайта. Но я не могу использовать «for (number ...)» внутри массива.Как я могу использовать «для» внутри «массива»?

<?php 
    // output headers so that the file is downloaded rather than displayed 
    header('Content-type: text/csv'); 
    header('Content-Disposition: attachment; filename="demo.csv"'); 

    // do not cache the file 
    header('Pragma: no-cache'); 
    header('Expires: 0'); 

    // create a file pointer connected to the output stream 
    $file = fopen('php://output', 'w'); 

    // send the column headers 
    fputcsv($file, array('Column 1', 'Column 2', 'Column 3')); 

    $json_string = "http://v2.notmaison.be/php/index.php?action=getRealEstateByNotaris&notaris=FRANCE,%20Gilles"; 
    $jsondata = file_get_contents($json_string); 
    $result = json_decode ($jsondata,true); 
    $nombre = count($result['results']); 

    $json = $result['results'][$numero]['im']; 
    $json_decoded = json_decode($json); 
    $data = array(

    for ($numero = 0; $numero < $nombre ; $numero++) { 
     Array($result['results'][$numero]['re_ru'],"test2","test3") 
    ); 
    } 

    // output each row of the data 
    foreach ($data as $row) { 
    fputcsv($file, $row); 
    } 

    exit(); 
?> 

У меня есть эта ошибка: ошибка парсера: ошибка синтаксиса, неожиданный 'для' (T_FOR), ожидая ')' в /htdocs/biens3.php на линии 25

+1

Я думаю, что ошибка говорит само за себя. – Ionut

+1

Знаете ли вы язык, на котором вы можете использовать 'for' в массиве? – RiggsFolly

+0

Я новичок, извините. –

ответ

0

вы должны использовать

for ($numero = 0; $numero < $nombre ; $numero++) 
    { 
     $data[] = Array($result['results'][$numero]['re_ru'],"test2","test3"); 
    } 
+0

Уоф! Спасибо огромное! Я не знал! –

0

Попробуйте объявить $ данные как пустой массив, то для каждого $ Nombre добавлении элемента/массив до $ данные, что-то Лик это:

$data = Array(); 

for($numero = 0; $numero < $nombre; $numero++){ 
    $data[] = Array($result['results'][$numero]['re_ru'],"test2","test3"); 
} 
0

Если ваша цель состоит в том, чтобы заполнить массив, вместо этого:

$data = array(

for ($numero = 0; $numero < $nombre ; $numero++) 
{ 
    Array($result['results'][$numero]['re_ru'],"test2","test3") 
); 
} 

Вы можете сначала создать массив, как вы делаете, но просто создать, и затем добавить элементы с помощью цикла:

$data = []; # shorter syntax than array(), but the same. 

for ($numero = 0; $numero < $nombre ; $numero++) 
{ 
    $data[] = [ 
     $result['results'][$numero]['re_ru'], 
     "test2", 
     "test3" 
    ]; 
} 

Синтаксис $data[] будет толкать элементы в конец массива. Примечание , что вам даже не нужно создавать массив. Я также заметил, что сразу после того, как вы зацикливаете на массиве для вывода его содержимого .А так как вы не используете $data в другом месте после того, как вы могли бы устранить его и ouptup данные в том же цикле:

for ($numero = 0; $numero < $nombre ; $numero++) 
{ 
    fputcsv($file, [ 
     $result['results'][$numero]['re_ru'], 
     "test2", 
     "test3" 
    ]); 
); 
0

Это является идеальным кандидатом для использования foreach, а не for

код может быть упрощена до этого

$json_string = "http://v2.notmaison.be/php/index.php?action=getRealEstateByNotaris&notaris=FRANCE,%20Gilles"; 
$jsondata = file_get_contents($json_string); 
$json_obj = json_decode ($jsondata); 

$csv_file = fopen('php://output', 'w'); 

foreach ($json_obj->results as $result) { 
    // to use all the fields from the json returned 
    fputcsv($csv_file, (array)$result); 
} 

Давать выход:

25174,CH-82691-16,0,50.4107048,4.4445519,2,12,1,,3,4,,"Appartement meublé (3ème étage) 2 chambres avec cave et garage.<br/>Hall, séjour, cuisine équipée, sdb, wc, buanderie, 2 chambres.<br/>Balcon avant avec tente solaire. Porte blindée. Cave. Garage. Ascenseur.<br/>",,6000,2,0,-1,95000,10,"Rue Basslé",Charleroi,0,1,0,1,-1,-1,1018,-1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,"FRANCE, Gilles","Maison du notariat de Charleroi",071/41.45.34,071/20.56.56,"Faire offre à partir de: 95000 €","S'adresser en l'étude.",-1,-1,-1,1,-1,-1,-1,-1,-1,-1,1,,,,,,,,,,,,"Classe B",201611231147,201611281115,[email protected],[email protected],,20161109022084,,,HA,,,,,OFF,,2,Appartements,"un appartement",12,Appartement,Appartement,2,1,Gré-à-Gré,,,,,3,Central,4,Equipée,"[""WEBB-AFYESF"",""WEBB-AFYES7"",""WEBB-AFYES9""]",238 
22691,CH-82112-16,0,50.4234543,4.4862727,1,8,1,,9,2,,"Maison de rapport avec 2 appartements.<br/>Hall commun de +/- 16 m².<br/>Appartement rez (+/- 45 m²): chambre (+/- 18 m²), séjour-sàm (+/- 10 m²), cuisine (+/- 4 m²), sdb (+/- 2,5 m²), cour arrière.<br/>Appartement 1er étage (+/- 51 m²): séjour-sàm (+/- 29 m²), chambre (+/- 17 m²), sdb (+/- 3 m²).<br/>Grenier aménageable (+/- 70 m²).<br/>Châssis SV.","Libre à l'acte.",6060,2,60,-1,80000,114,"Rue Hanoteau",Gilly,0,-1,0,0,1,-1,594,-1,-1,-1,-1,-1,1,-1,2,2,-1,-1,-1,2,-1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,"FRANCE, Gilles","Maison du notariat de Charleroi",071/41.45.34,071/20.56.56,"Faire offre à partir de: 80000 €","S'adresser en l'étude.",1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,,,,,,,,,,,,"Classe E",201607191431,201607250944,[email protected],[email protected],,20160228005227,,,HA,,,,,OFF,,1,Maisons,"une maison",8,"Maison de rapport",Opbrengsteigendom,1,1,Gré-à-Gré,,,,,9,"Foyer gaz",2,"Non équipée","[""WEBB-ABZGY2"",""WEBB-ABZGY5""]",238 
15311,CH-80259-15,0,50.4291858,4.4990644,1,7,1,,5,2,,"Maison avec jardin.<br/>Sous-sol: cave.<br/>Rez: sàm, living.<br/>Annexe: cuisine, sdb avec wc séparé, buanderie.<br/>Etage: 2 chambres.<br/>Grenier, jardin.<br/>Châssis PVC double vitrage.",,6060,2,432,-1,55000,31,"Rue Brasserie Gillieaux",Gilly,0,-1,1,0,-1,-1,282,-1,-1,1,-1,-1,-1,1,-1,1,-1,-1,-1,1,-1,1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,"FRANCE, Gilles","Maison du notariat de Charleroi",071/41.45.34,071/20.56.56,"Faire offre à partir de: 55000 €","S'adresser en l'étude.",-1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,,,,,,,,,,,,"Classe G",201509011601,201601060955,[email protected],[email protected],G,20150507024064,513,60394,HA,,,,,OFF,,1,Maisons,"une maison",7,"Maison d'habitation",Woonhuis,1,1,Gré-à-Gré,,,,,5,"Central mazout",2,"Non équipée","[""WEBB-9ZXJLP"",""WEBB-9ZXJLS"",""WEBB-9ZXJMS""]",238 
24222,CH-82449-16,0,50.4276111,4.472657,4,39,1,,4,2,,"Immeuble de rapport avec commerce (et cour) au rez et 2 appartements.<br/>Sous-sol de 65 m².<br/>Rez commercial de 70 m²: commerce et pièce arrière avec WC. Cour.<br/>1er étage: appartement de 63 m² avec balcon: cuisine, séjour/sàm, hall, 1 chambre, sdb.<br/>2ème étage: appartement de 70 m² avec balcon: cuisine, séjour/sàm, débarras, hall, WC, sdb, 1 chambre.<br/>CC gaz, 3 chaudières séparées.<br/>citerne eau de pluie. Compteurs gaz et électricité séparés.",,6060,2,147,-1,160000,198,"Chaussée de Lodelinsart",Gilly,0,-1,0,0,-1,-1,1682,-1,-1,2,-1,-1,2,-1,2,2,-1,-1,-1,2,-1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,"FRANCE, Gilles","Maison du notariat de Charleroi",071/41.45.34,071/20.56.56,"Faire offre à partir de: 160000 €","S'adresser en l'étude.",-1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,,,,,,,,,,,,"Classe G",201610101349,201610191534,[email protected],[email protected],,20161003008071,,,HA,,,,,OFF,,4,"Bureaux/Commerces","un bureau/commerce",39,"Maison de rapport",Opbrengsteigendom,4,1,Gré-à-Gré,,,,,4,"Central gaz",2,"Non équipée","[""WEBB-AELG3S"",""WEBB-AEVHX6"",""WEBB-AEVHX8"",""WEBB-AEVHXA"",""WEBB-AEVHXC"",""WEBB-AEVHXE""]",238 
24617,CH-82546-16,0,50.3780923,4.3711288,1,7,1,,4,1,5,"Sous-sol : caves<br/>Rez-de-chaussée (40 m²) : hall, séjour, cuisine<br/>1er étage (40m²) : hall, 2 chambres, salle de bain <br/>Grenier aménageable<br/>Jardin et cour<br/>Garage<br/>Chauffage central au gaz <br/>Châssis double vitrage PVC et aluminium<br/>R.C.: 431,00 €<br/>Superficie : 3 ares 30 centiares<br/>PEB N° 20161020028100: classe E<br/>Faire offre à partir de 85.000,00 € . <br/>Offre actuelle : 85.000,00 €.<br/>       <br/>",,6110,2,330,-1,85000,334,"Rue de Gozée",Montigny-le-Tilleul,3,-1,1,1,1,-1,431,-1,-1,1,-1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,-1,2,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,"FRANCE, Gilles","Maison du notariat de Charleroi",071/41.45.34,071/20.56.56,"Faire offre à partir de: 85000 €","S'adresser en l'étude.",0,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,,,,,,,,,,,,,201610261444,201611080845,[email protected],[email protected],,20161020028100,,,HA,,,,,OFF,,1,Maisons,"une maison",7,"Maison d'habitation",Woonhuis,1,1,Gré-à-Gré,,,5,Bon,4,"Central gaz",1,Présente,"[""WEBB-AF4H3P""]",238 
25383,CH-82753-16,0,50.3439488,4.4577754,3,18,1,,,,,"Terrain de 9 ares 58ca.<br/>Lot sous teinte blanche.",,6120,0,958,-1,85000,,"Rue de la Ferrée",Nalinnes,0,-1,0,0,-1,-1,5,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,"FRANCE, Gilles","Maison du notariat de Charleroi",071/41.45.34,071/20.56.56,"Faire offre à partir de: 85000 €","Sur place.",-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,,,,,,,,,,,,,201612021139,201612021141,[email protected],[email protected],,,,,HA,,,,,OFF,,3,Terrains,"un terrain",18,"Prairies/pâtures",Weide,3,1,Gré-à-Gré,,,,,,,,,"[""WEBB-AG9EJM"",""WEBB-AG9EJP""]",238 
18716,CH-81190-16,0,50.4239506,4.4872409,1,7,1,,5,2,,"Maison avec jardin.<br/>Sous-sol: cave avec voussettes.<br/>Rez: hall, séjour-sàm, WC.<br/>Annexe: cuisine, sdb.<br/>1er étage: hall, 3 chambres.<br/>Annexe au 1er étage: 1 chambre, WC, pièce.<br/>Grenier aménageable.<br/>Jardin à l'arrière. Châssis DV en partie et volets en partie.<br/>",,6060,4,220,-1,80000,11,"Rue de la Station",Gilly,0,-1,1,0,1,-1,773,-1,-1,2,-1,-1,1,-1,1,1,-1,-1,-1,1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,"FRANCE, Gilles","Maison du notariat de Charleroi",071/41.45.34,071/20.56.56,"Faire offre à partir de: 80000 €","S'adresser en l'étude.",-1,-1,-1,1,1,-1,-1,-1,-1,-1,-1,,,,,,,,,,,,"Classe G",201602050944,201608081422,[email protected],[email protected],G,20160128025502,528,,HA,,,,,OFF,,1,Maisons,"une maison",7,"Maison d'habitation",Woonhuis,1,1,Gré-à-Gré,,,,,5,"Central mazout",2,"Non équipée","[""WEBB-A6UCCX"",""WEBB-A6UCCY"",""WEBB-A6UCD2""]",238 
25159,CH-82686-16,0,50.4253111,4.501545,1,7,1,,,2,,"Maison 3 façades avec jardin.<br/>Sous-sol: caves.<br/>Rez: séjour, sàm avec coin cuisine, WC.<br/>1er étage: hall, 2 chambres.<br/>Grenier aménageable. Jardin.<br/>chauffage au charbon.<br/>Châssis DV PVC sauf un en façade.",,6060,2,350,-1,60000,47,"Rue de la Plateure",Gilly,3,-1,1,0,1,-1,297,-1,-1,1,-1,-1,1,-1,1,1,-1,-1,-1,0,-1,-1,2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,"FRANCE, Gilles","Maison du notariat de Charleroi",071/41.45.34,071/20.56.56,"Faire offre à partir de: 60000 €","S'adresser en l'étude.",-1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,,,,,,,,,,,,"Classe G",201611221617,201611221625,[email protected],[email protected],,201604280334591,,,HA,,,,,OFF,,1,Maisons,"une maison",7,"Maison d'habitation",Woonhuis,1,1,Gré-à-Gré,,,,,,,2,"Non équipée","[""WEBB-AFXL43"",""WEBB-AFXL4H""]",238 
24585,CH-82540-16,0,50.422774,4.4799037,2,12,1,,4,4,,"Appartement (2ème étage) comprenant hall, séjour, cuisine (frigo, four électrique et hotte), sdb avec douche multi confort, chambre.<br/>Balcon arrière, cave.",,6060,1,0,-1,55000,5,"Chaussée de Lodelinsart",Gilly,0,1,0,0,-1,-1,706,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,"FRANCE, Gilles","Maison du notariat de Charleroi",071/41.45.34,071/20.56.56,"Faire offre à partir de: 55000 €","S'adresser en l'étude.",-1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,,,,,,,,,,,,"Classe F",201610251409,201610251416,[email protected],[email protected],,20161017025827,,,HA,,,,,OFF,,2,Appartements,"un appartement",12,Appartement,Appartement,2,1,Gré-à-Gré,,,,,4,"Central gaz",4,Equipée,"[""WEBB-AF3GDJ"",""WEBB-AF3GDL""]",238 
22272,CH-82012-16,0,50.40205,4.5199634,1,7,1,,3,2,,"Maison avec dépendances et garage.<br/>Rez (+/- 50 m²): hall, cuisine, 1 pièce.<br/>1er étage (+/- 65 m²): hall, 4 chambres.<br/>2ème étage (+/- 60 m²): hall, sdb, 3 chambres.<br/>Grenier (+/- 45 m²) aménageable.<br/>Chauffage central, terrasse, jardin.<br/>RC du n°72: 535€ - RC du n°74: 97€.",,6200,7,228,-1,80000,72/74,"Rue d'Acoz",Châtelet,0,1,1,1,1,-1,632,-1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,"FRANCE, Gilles","Maison du notariat de Charleroi",071/41.45.34,071/20.56.56,"Faire offre à partir de: 80000 €","S'adresser en l'étude.",-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,,,,,,,,,,,,"Classe G",201606291112,201606291117,[email protected],[email protected],,20160120016969,,,HA,,,,,OFF,,1,Maisons,"une maison",7,"Maison d'habitation",Woonhuis,1,1,Gré-à-Gré,,,,,3,Central,2,"Non équipée","[""WEBB-ABDCWC"",""WEBB-ABDCWJ""]",238 
22955,CH-82160-16,0,50.1681918,4.3181224,1,2,1,,9,4,5,"Châlet de 65m² meublé avec jardin comprenant :<br/> <br/>Living, cuisine, 2 chambres, salle de bains <br/>Jardin avec deux chalets <br/>Convecteurs pétrole avec thermostat<br/>Boiler au gaz <br/>PEB : F<br/>",,6440,2,280,-1,50000,314,"Parc Résidentiel Le Bosquet",Fourbechies,4,-1,1,0,-1,1,265,-1,-1,1,-1,-1,-1,1,-1,-1,-1,-1,-1,1,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,"FRANCE, Gilles","Maison du notariat de Charleroi",071/41.45.34,071/20.56.56,"Faire offre à partir de: 50000 €","S'adresser en l'étude.",2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,,,,,,,,,,,,,201608081032,201608081036,[email protected],[email protected],,20160707022876,,,HA,,,,,OFF,,1,Maisons,"une maison",2,Châlet,Chalet,1,1,Gré-à-Gré,,,5,Bon,9,"Foyer gaz",4,Equipée,"[""WEBB-ACMC4J"",""WEBB-ACMC4S"",""WEBB-ACMC4X""]",238 
25119,CH-82675-16,0,50.4328324,4.467517,1,7,1,4,2,,3,"Maison incendiée 3 façades avec jardin composée de :<br/>Sous-sol : caves.<br/>Rez-de-chaussée : + 43m²<br/>1er étage: + 43m²<br/>Grenier aménageable<br/>Jardin <br/>Offres à partir de 60.000,00€<br/>Offre actuelle : 75.000,00 €<br/><br/><br/> <br/> <br/><br/>",,6060,1,367,-1,60000,111,"Rue Chausteur",Gilly,3,-1,1,0,1,0,609,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,1,-1,-1,1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,"FRANCE, Gilles","Maison du notariat de Charleroi",071/41.45.34,071/20.56.56,"Faire offre à partir de: 60000 €","S'adresser en l'étude.",0,-1,0,-1,-1,-1,-1,-1,-1,-1,0,,,,,,,,,,,,,201611210950,201612051553,[email protected],[email protected],,,,,HA,,,,,OFF,,1,Maisons,"une maison",7,"Maison d'habitation",Woonhuis,1,1,Gré-à-Gré,4,Oui,3,Mauvais,2,"A installer",,,"[""WEBB-AFWCFT""]",238 

Или, если вы хотите только определенные поля из JSON

$json_string = "http://v2.notmaison.be/php/index.php?action=getRealEstateByNotaris&notaris=FRANCE,%20Gilles"; 
$jsondata = file_get_contents($json_string); 
$json_obj = json_decode ($jsondata); 

$csv_file = fopen('php://output', 'w'); 

foreach ($json_obj->results as $result) { 
    // to use only specific fields from the input 
    fputcsv($csv_file, array($result->re_nu, $result->re_ru)); 
} 

Давать CSV, как этого

10,"Rue Basslé" 
114,"Rue Hanoteau" 
31,"Rue Brasserie Gillieaux" 
198,"Chaussée de Lodelinsart" 
334,"Rue de Gozée" 
,"Rue de la Ferrée" 
11,"Rue de la Station" 
47,"Rue de la Plateure" 
5,"Chaussée de Lodelinsart" 
72/74,"Rue d'Acoz" 
314,"Parc Résidentiel Le Bosquet" 
111,"Rue Chausteur" 

EDIT для второго вопроса

Если вы хотите, коды картинок в вашей продукции тогда это сделало бы это

foreach ($json_obj->results as $result) { 
    $required = array(); // init an array 

    // pick fields wanted in resulting csv 
    $required[] = $result->re_nu; 
    $required[] = $result->re_ru; 

    // get the images 
    $im_codes = json_decode($result->im); 
    foreach ($im_codes as $im) { 
     $required[] = 'http://photos.notmaison.be/photos/m' . $im . '.jpg'; 
    } 

    fputcsv($csv_file, $required); 
} 

сгенерированным:

10,"Rue Basslé",http://photos.notmaison.be/photos/mWEBB-AFYESF.jpg,http://photos.notmaison.be/photos/mWEBB-AFYES7.jpg,http://photos.notmaison.be/photos/mWEBB-AFYES9.jpg 
114,"Rue Hanoteau",http://photos.notmaison.be/photos/mWEBB-ABZGY2.jpg,http://photos.notmaison.be/photos/mWEBB-ABZGY5.jpg 
31,"Rue Brasserie Gillieaux",http://photos.notmaison.be/photos/mWEBB-9ZXJLP.jpg,http://photos.notmaison.be/photos/mWEBB-9ZXJLS.jpg,http://photos.notmaison.be/photos/mWEBB-9ZXJMS.jpg 
198,"Chaussée de Lodelinsart",http://photos.notmaison.be/photos/mWEBB-AELG3S.jpg,http://photos.notmaison.be/photos/mWEBB-AEVHX6.jpg,http://photos.notmaison.be/photos/mWEBB-AEVHX8.jpg,http://photos.notmaison.be/photos/mWEBB-AEVHXA.jpg,http://photos.notmaison.be/photos/mWEBB-AEVHXC.jpg,http://photos.notmaison.be/photos/mWEBB-AEVHXE.jpg 
334,"Rue de Gozée",http://photos.notmaison.be/photos/mWEBB-AF4H3P.jpg 
,"Rue de la Ferrée",http://photos.notmaison.be/photos/mWEBB-AG9EJM.jpg,http://photos.notmaison.be/photos/mWEBB-AG9EJP.jpg 
11,"Rue de la Station",http://photos.notmaison.be/photos/mWEBB-A6UCCX.jpg,http://photos.notmaison.be/photos/mWEBB-A6UCCY.jpg,http://photos.notmaison.be/photos/mWEBB-A6UCD2.jpg 
47,"Rue de la Plateure",http://photos.notmaison.be/photos/mWEBB-AFXL43.jpg,http://photos.notmaison.be/photos/mWEBB-AFXL4H.jpg 
5,"Chaussée de Lodelinsart",http://photos.notmaison.be/photos/mWEBB-AF3GDJ.jpg,http://photos.notmaison.be/photos/mWEBB-AF3GDL.jpg 
72/74,"Rue d'Acoz",http://photos.notmaison.be/photos/mWEBB-ABDCWC.jpg,http://photos.notmaison.be/photos/mWEBB-ABDCWJ.jpg 
314,"Parc Résidentiel Le Bosquet",http://photos.notmaison.be/photos/mWEBB-ACMC4J.jpg,http://photos.notmaison.be/photos/mWEBB-ACMC4S.jpg,http://photos.notmaison.be/photos/mWEBB-ACMC4X.jpg 
111,"Rue Chausteur",http://photos.notmaison.be/photos/mWEBB-AFWCFT.jpg 
+0

Когда я использую свой код, мне нужно вывести в то же время [ "" УЭББ-AFYESF "", "" УЭББ-AFYES7 "", "" УЭББ-AFYES9 ""] в CSV как " http://photos.notmaison.be/photos/mWEBB-AFYESF.jpg ", " http://photos.notmaison.be/photos/mWEBB-AFYES7.jpg ", " http: //photos.notmaison. be/photos/mWEBB-AFYES9.jpg " Я не могу с кодом –

+0

Вы можете добавить код для этого! – RiggsFolly

+0

Не знаю, как это сделать :( –

-1

Мне нужно вывести в то же время

[""WEBB-AFYESF"",""WEBB-AFYES7"",""WEBB-AFYES9""] 

в CSV, как

"http://photos.notmaison.be/photos/mWEBB-AFYESF.jpg", 
"http://photos.notmaison.be/photos/mWEBB-AFYES7.jpg", 
"http://photos.notmaison.be/photos/mWEBB-AFYES9.jpg" 
Смежные вопросы