I want to do something like that:
I have a textfield. If the user inputs Some word search, it puts something (it is not necessary, what) after every words, except last like Some 1 word 2 search or Some asdf word asdf search. How can I do that? Thanks!

if the part you want to add is the same (after the words) then I think you can use preg_replace, something like this:

$subject = 'Some word search';
$result = preg_replace('%(\w+)( )(/w+)*%m', '$1 asdf $3', $subject);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.