<?php $str="Hello, my name is dor."; $cut=explode("my ", $str); $cut=explode(" is", $cut[1]); $str=$cut[0]; echo $str; ?>