ezis Posted November 30, 2011 Report Share Posted November 30, 2011 piemēram ir strings: $str = "<br /> 'kkas' <br />"; Ar preg_replace vajag izņemt whitespace starp > un single quote un single quote un <! Kā iekš regex eskeipo single quote ? o0 Neder vienkārša atstarpju aizvākšana, vajadzētu tieši šādā patternā.. . Link to comment Share on other sites More sharing options...
reiniger Posted November 30, 2011 Report Share Posted November 30, 2011 varbūt noder trim() Link to comment Share on other sites More sharing options...
ezis Posted November 30, 2011 Author Report Share Posted November 30, 2011 Diemžēl šajā gadījumā nē. Link to comment Share on other sites More sharing options...
reiniger Posted November 30, 2011 Report Share Posted November 30, 2011 Kaut kas šāds neder $str = "<br /> 'kkas' <br />"; $ar = array('> \'', '\' <'); $ar_ = array('>\'', '\'<'); $str = str_replace($ar , $ar_, $str); echo $str; Link to comment Share on other sites More sharing options...
ezis Posted November 30, 2011 Author Report Share Posted November 30, 2011 hmm, izskatās, ka der arī šādi. Paldies! Link to comment Share on other sites More sharing options...
briedis Posted November 30, 2011 Report Share Posted November 30, 2011 Varu piedāvāt šādu te variantu: echo str_replace("<br /> 'kkas' <br />", "<br />\\'kkas\\'< br/>", "<br /> 'kkas' <br />"); Tavām prasībām atbilst :) Link to comment Share on other sites More sharing options...
ezis Posted November 30, 2011 Author Report Share Posted November 30, 2011 ^^ Šim konkrētajam variantam noteikti! Patiesība man vajadzēja nedaudz savādāk! (: Link to comment Share on other sites More sharing options...
Recommended Posts