Salux à tous,
J'ai besoin d'une coup de pouce pour réaliser une recherche d'un mot dans la chaîne d'un tableau afin de récupérer la clé.
En effet, j'ai utilisé la fonction array_search() qui fonctionne très bien lorsque la case correspond parfaitement.
Mais j'ai des cas où je n'ai qu'un mot qui est dans la chaîne de caractère et là cela dépasse les compétences de mon apprentissage
Pour être plus concret voici des extraits de var_dump() et le mot que cherche : MARLIN
Merci d'avance pour l'aide qui me mettra sur le droit chemin.
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 array(8) { [0]=> string(19) "PRIX JACQUES GELIOT" [1]=> string(37) "PRIX DE LA SOCIETE DES COURSES DU PIN" [2]=> string(22) "PRIX CAPITAINE LABONDE" [3]=> string(16) "PRIX DES DAGUETS" [4]=> string(16) "PRIX DE BOULIGNY" [5]=> string(26) "PRIX COLONEL JEAN DE ROYER" [6]=> string(27) "PRIX COLONEL BERNARD MARLIN" [7]=> string(20) "PRIX DES HERONNIERES" } array(8) { [0]=> string(9) "J. GELIOT" [1]=> string(15) "STE CSES DU PIN" [2]=> string(11) "Cne LABONDE" [3]=> string(7) "DAGUETS" [4]=> string(8) "BOULIGNY" [5]=> string(12) "Cel DE ROYER" [6]=> string(13) "Cel B. MARLIN" [7]=> string(11) "HERONNIERES" }
GaLaGaNN
Partager