Bonjour,
j'explique mon problème, j'ai une string:
pour que je puisse faire mon affichage correctement, j'ai besoin de transformer la string ci-dessus en celle ci-dessous:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 $texte='{ "costingImport.explication" : "You can include a cost breakdown sheet in <b>excel format (.xls or .xlsx)</b>."+ "<br> - If this cost breakdown sheet contains blocking errors, it will not be included and you will stay on this page. A list of the cells containing errors will appear."+ "<br> - If there isnt any blocking error, the cost breakdown sheet will be saved and will go to the next step (BEING CREATED). You will be redirected on the screen of the cost breakdown sheet."+ "<br> - If there is no possible attachment between a data on the sheet and the applications repository (example : non-existent material, supplier not referenced), this data will be deleted. You will have to update the settings of the application, then edit the cost breakdown sheet.", "costingImport.btn.import": "Import", }';
visiblement un regex semble pouvoir résolver ce problème mais la ou je bloque c'est sur l'écriture de ce même regex qui ressemble mot pour mot au texte écrit dans ce smiley =>
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 $texte='{ "costingImport.explication" : "You can include a cost breakdown sheet in <b>excel format (.xls or .xlsx)</b>. <br> - If this cost breakdown sheet contains blocking errors, it will not be included and you will stay on this page. A list of the cells containing errors will appear. <br> - If there isnt any blocking error, the cost breakdown sheet will be saved and will go to the next step (BEING CREATED). You will be redirected on the screen of the cost breakdown sheet. <br> - If there is no possible attachment between a data on the sheet and the applications repository (example : non-existent material, supplier not referenced), this data will be deleted. You will have to update the settings of the application, then edit the cost breakdown sheet.", "costingImport.btn.import": "Import", }';
j'ai quand même tenté ma chance mais mon code manque visiblement de talent ^^'
quelqu'un peut-il m'aider pour la syntaxe ?
Code php : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 $texte2=preg_replace('/(?="+).*?(?=")/','',$texte);
Partager