cindreta Posted April 22, 2008 Share Posted April 22, 2008 first im sorry for my bad english i'll try to explain as much as i can. So i have a system build on php/mysql and it adds articles to a database. And now i wanna ad tags for every article, and i wanna do that so that i can for instance say that every tag will be separated by "," or "space" (example: first tag,secon tag...etc). And i need to insert those tags into a databes for that article. Later i need to use thosse tags for auto suggest searching. SO how do i do that? Thank you Link to comment https://forums.phpfreaks.com/topic/102306-php-word-separation-help/ Share on other sites More sharing options...
ToonMariner Posted April 22, 2008 Share Posted April 22, 2008 how do you want to do it??? Link to comment https://forums.phpfreaks.com/topic/102306-php-word-separation-help/#findComment-523818 Share on other sites More sharing options...
cindreta Posted April 22, 2008 Author Share Posted April 22, 2008 like i said i just need the code that will do the following: i have a input field named "tags", and when somebody enters multiple tags separated by a comma ","(example: tag1,tag2,tag3), and then submits that...the code will break thosse tags one by one (by that i mean that when the script sees a comma he threats that as one tag and inserts it into a database). Do you get what i mean? i just need something that will insert the array of those tags separated by a comma into a databes for tags and then later on i need it to search articles by tags, so that the entered tags come out separate. Link to comment https://forums.phpfreaks.com/topic/102306-php-word-separation-help/#findComment-523823 Share on other sites More sharing options...
ToonMariner Posted April 22, 2008 Share Posted April 22, 2008 well on submission of the form you could use: split(' |,',$_POST['tags']); explode(',', $_POST['tags']); or any other similar function to produce the desired array of values - you can then loop through these to add to the database. Link to comment https://forums.phpfreaks.com/topic/102306-php-word-separation-help/#findComment-523891 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.