Fernanditos
asked on
Help Building a Function to create coma separated string
Hi,
I need help creating a PHP function CreateMetaKeywords($string );
I have one string with a description:
$description = "Create Wind And Solar' Power Systems are alternative & ecologic systems* ";
$exclude array = "create, last, plane";
function should return a string:
1- excluding all non alpha characters
2- excluding the words in $exclude array.
3- excluding words with <= 3 characters
4- Return first 6 remaining words separated by a comma.
Output should be:
"Wind, Solar, Power, systems, alternative, ecologic"
I do appreciate any help with this code.
Thank in advance.
I need help creating a PHP function CreateMetaKeywords($string
I have one string with a description:
$description = "Create Wind And Solar' Power Systems are alternative & ecologic systems* ";
$exclude array = "create, last, plane";
function should return a string:
1- excluding all non alpha characters
2- excluding the words in $exclude array.
3- excluding words with <= 3 characters
4- Return first 6 remaining words separated by a comma.
Output should be:
"Wind, Solar, Power, systems, alternative, ecologic"
I do appreciate any help with this code.
Thank in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Amazing, as usual!
ASKER
I just posted a related question here: https://www.experts-exchange.com/questions/27874721/Removing-duplicated-words-from-string.html
Following is code which can help you in creating a function you want
Open in new window
Hope this will help you.
Thank you.
Amar Bardoliwala