<?php $text = "Course: Natural Language Processing, Text book: An Introduction to Natural Language Processing."; $arrCmpltPhrase = array(); $arrCmpltPhrase = get_complete_phrases($text); echo "complete phrase extracted: <br>"; print_r($arrCmpltPhrase); ?>