php - String has the same value repeated after space -


i need remove duplicate, don't know how call exactly

$string = "this sample sample" 

as can see there "this sample" twice in single string. have many strings (with of course different text, repeated again) , need bulk remove duplicate text, don't have idea how this. result want is:

$string = "this sample" 

try this:

<?php     $text = "this sample sample";     echo $splitstring1 = substr($text, 0, floor(strlen($text) / 2)); ?> 

i hope can you


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -