php - setting default on full text search mysql -


this first time using full text search mysql using innodb. i've read in docs, have option prepend (+) plus sign trim result more.

my question can have default searching automatically prepend + when user entered word/s.

eg. user entered following:

  • one 2 => (no + sign) result +one +two
  • elliot wizard => (no + sign) result +elliot +wizard

in mysql search words containing + though user didn't include +.

ps: searched first in internet , did't find article has solution this..

please help.

regards,

you can achieve this:

<?php   $string = 'this string';   $stringwithplus = '+'.implode('+',explode(' ',$string));   echo $stringwithplus; ?> 

Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -