I have predefined an array:
$tags = array('PHP', 'Webdesign', 'Wordpress', 'Drupal', 'SQL');
Now I am inputting a value into a text area:
$text = 'Working With WordPress Shortcodes and doing some NoSQL and SQL';
How can I compare the string value with the predefined array?
The desired result I want based on the above is ‘WordPress’ and ‘SQL’
Can I do it in PHP and JQuery?
Also, if it will contain a regular expression like
Working With WordPress; Shortcodes: and doing some NoSQL and ""SQL
Then what to do?
You should split your string like so
Then compare like so
Now result_array will contain every value that is in both of the arrays 🙂