Bonjour,

Avec ma fonction, je retourne deux tableaux :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
    /**
     * Parse du fichier CSV
     * 
     * @return array
     */
    private function parseCSV()
    {
        $em = $this->getContainer()->get('doctrine')->getManager();
 
        $qb = $em->getRepository('Carvivo\CrmBundle\Entity\User\User')
                ->createQueryBuilder('u')
                ->select('u.username')
                ->where('u.organization = 505');
 
        $users = $qb->getQuery()->execute();
 
        $finder = new Finder();
        $finder->files()
            ->in($this->csvParsingOptions['finder_in'])
            ->name($this->csvParsingOptions['finder_name']);
 
        foreach ($finder as $file) { $csv = $file; }
 
        $rows = array();
 
        if (($handle = fopen($csv->getRealPath(), "r")) !== FALSE)
        {
            $i = 0;
            while (($data = fgetcsv($handle, null, ";")) !== FALSE)
            {
                $i++;
                $rows[] = $data;
            }
            fclose($handle);
        }
 
        dump($users, $rows);
    }
https://image.noelshack.com/fichiers...12-capture.png

J'aimerais vérifier l’occurrence du premier tableau dans le deuxième. Les in_array ne fonctionnent pas

Merci pour votre aide