<?php $word = "'Ankara'da!?'";echo preg_replace('~^\s+|\s+$|(\s){2,}~u', '$1', preg_replace('~(?!\b\'\b)\p{P}~u', ' $0 ', $word));
Standard input is empty
' Ankara'da ! ? '
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!