anonīms Posted December 17, 2012 Report Share Posted December 17, 2012 http://paste.php.lv/7e97a951effe899dc3fd2e734f5b508f/nonum Kāpēc man tiek atgriezts tikai 1 rezultāts? tb atsauce (bez 1), netiek atgriezta) Array( [0] => Array ( [0] => [TOOLTIP]atsauce1[TEXT]Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam consectetur posuere tellus[/TEXT][/TOOLTIP] sit amet, consectetur adipiscing elit. Nam consectetur posuere tellus, sit amet tempor augue tempus vel. Mauris nec imperdiet mauris. Sed pharetra blandit justo at auctor. Quisque non laoreet sem. [TOOLTIP]atsauce[TEXT]Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam consectetur posuere tellus[/TEXT][/TOOLTIP] ) [1] => Array ( [0] => atsauce1[TEXT]Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam consectetur posuere tellus[/TEXT][/TOOLTIP] sit amet, consectetur adipiscing elit. Nam consectetur posuere tellus, sit amet tempor augue tempus vel. Mauris nec imperdiet mauris. Sed pharetra blandit justo at auctor. Quisque non laoreet sem. [TOOLTIP]atsauce[TEXT]Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam consectetur posuere tellus[/TEXT] )) Link to comment Share on other sites More sharing options...
rpr Posted December 17, 2012 Report Share Posted December 17, 2012 tāpēc, ka viņš paņem visu sākot no tooltip un beidzot ar /tooltip, bet pa vidu vēl ir /tooltip un tooltip... mēģini kaut kā tā: \[tooltip\][^(\[/tooltip\])]*[/tooltip\] Link to comment Share on other sites More sharing options...
aaxc Posted December 17, 2012 Report Share Posted December 17, 2012 <?php $text = 'Lorem dolor [TOOLTIP]atsauce1[TEXT]Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam consectetur posuere tellus[/TEXT][/TOOLTIP] sit amet, consectetur adipiscing elit. Nam consectetur posuere tellus, sit amet tempor augue tempus vel. Mauris nec imperdiet mauris. Sed pharetra blandit justo at auctor. Quisque non laoreet sem. [TOOLTIP]atsauce[TEXT]Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam consectetur posuere tellus[/TEXT][/TOOLTIP]'; preg_match_all("/\[TOOLTIP\](.*?)\[\/TOOLTIP\]/", $text, $matches); print '<pre>'; print_r($matches); print '</pre>'; ?> Link to comment Share on other sites More sharing options...
anonīms Posted December 17, 2012 Author Report Share Posted December 17, 2012 aaxc, jap! Tencinu Link to comment Share on other sites More sharing options...
aaxc Posted December 17, 2012 Report Share Posted December 17, 2012 /closed Link to comment Share on other sites More sharing options...
Recommended Posts