par
SamOliver » 24 févr. 2015, 15:28
Bonjour
J'ai la chaîne suivante
Code : Tout sélectionner
<table:table-row table:style-name="Tableau3.2">
<table:table-cell table:style-name="Tableau3.A2" office:value-type="string">
<text:p text:style-name="P32">AB1</text:p>
</table:table-cell>
<table:table-cell table:style-name="Tableau3.A2" office:value-type="string">
<text:p text:style-name="P21">AB2</text:p>
</table:table-cell>
<table:table-cell table:style-name="Tableau3.A2" office:value-type="string">
<text:p text:style-name="P21">AB3</text:p>
</table:table-cell>
<table:table-cell table:style-name="Tableau3.A2" office:value-type="string">
<text:p text:style-name="P21">AB4</text:p>
</table:table-cell>
<table:table-cell table:style-name="Tableau3.A2" office:value-type="string">
<text:p text:style-name="P21">AB5</text:p>
</table:table-cell>
<table:table-cell table:style-name="Tableau3.F2" office:value-type="string">
<text:p text:style-name="P21">AB6</text:p>
</table:table-cell>
</table:table-row>
J'aimerai soustraire la chaîne suivante :
sachant que P21 est une variable inconnue
Quand je fais
Code : Tout sélectionner
$reg1 = "#<text:p text:style-name=(.*)>AB4</text:p>#";
preg_match_all($reg1, $this->xml, $matches);
ça me retourne la chaîne entière, alors que je veux soustraire que la chaîne en question.
Merci d'avance pour votre aide.
Bonjour
J'ai la chaîne suivante
[code]<table:table-row table:style-name="Tableau3.2">
<table:table-cell table:style-name="Tableau3.A2" office:value-type="string">
<text:p text:style-name="P32">AB1</text:p>
</table:table-cell>
<table:table-cell table:style-name="Tableau3.A2" office:value-type="string">
<text:p text:style-name="P21">AB2</text:p>
</table:table-cell>
<table:table-cell table:style-name="Tableau3.A2" office:value-type="string">
<text:p text:style-name="P21">AB3</text:p>
</table:table-cell>
<table:table-cell table:style-name="Tableau3.A2" office:value-type="string">
<text:p text:style-name="P21">AB4</text:p>
</table:table-cell>
<table:table-cell table:style-name="Tableau3.A2" office:value-type="string">
<text:p text:style-name="P21">AB5</text:p>
</table:table-cell>
<table:table-cell table:style-name="Tableau3.F2" office:value-type="string">
<text:p text:style-name="P21">AB6</text:p>
</table:table-cell>
</table:table-row>[/code]
J'aimerai soustraire la chaîne suivante :
[code]<text:p text:style-name="P21">AB4</text:p>[/code] sachant que P21 est une variable inconnue
Quand je fais
[code]
$reg1 = "#<text:p text:style-name=(.*)>AB4</text:p>#";
preg_match_all($reg1, $this->xml, $matches);
[/code]
ça me retourne la chaîne entière, alors que je veux soustraire que la chaîne en question. [code]<text:p text:style-name="P21">AB4</text:p>[/code]
Merci d'avance pour votre aide.