3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = "<heading>فهرست اول</heading>hi my name is mahdi whats app <heading>فهرست دوم</heading>how are you<heading>فهرست اول</heading>hi my name is mahdi whats app2 <heading>فهرست دوم</heading>how are you2"; $oldpos =0; $pos =strpos($content, "<heading>",1); While($pos !== false){ $arr[] = Substr($content, $oldpos, $pos-$oldpos); $oldpos = $pos; $pos =strpos($content, "<heading>",$oldpos+1); } $arr[] = Substr($content, $oldpos); Var_dump($arr);
Output for git.master, git.master_jit, rfc.property-hooks
array(4) { [0]=> string(67) "<heading>فهرست اول</heading>hi my name is mahdi whats app " [1]=> string(47) "<heading>فهرست دوم</heading>how are you" [2]=> string(68) "<heading>فهرست اول</heading>hi my name is mahdi whats app2 " [3]=> string(48) "<heading>فهرست دوم</heading>how are you2" }

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
21.94 ms | 402 KiB | 8 Q