// given an array in the form:
$arrX = array(
'6' => 'English||Spanish'
'8' => 'English||Portuguese||Finnish'
// ...etc...
);
// define a new array & loop thru $arrX like so:
$arrTmp = array()
foreach ($arrX as $langs) {
$arrTmp = array_merge($arrTmp, explode('||',
On Sun, 2004-02-01 at 21:26, Richard Kurth wrote:
> each time it looks at a new record it list all the languages that that
> person speaks with a double pipe in between each language.
>
> What I need to do is find all the unique languages so I can generate a
> list of languages that do not have an
Here's some skeleton code showing one way (untested, no error checking shown):
$query = 'SELECT Language FROM whatever';
$result = mysql_query($query);
$languages = array();
while ($row=mysql_fetch_object($result))
$languages = array_merge($languages
Hello Richard,
Normally the distinct calause in sql serves this purpose but it seems
that the way your DB is designed you cannot make use of it. The bad news
is that you might have to read all the rows split them by the pipe
symbol and insert them into a list manually. ouch!
Richard Kurth w
On Monday 02 February 2004 10:26, Richard Kurth wrote:
> What I need to do is find all the unique languages so I can generate a
> list of languages that do not have any repeats in it. so the list above
> would be English,Portuguese,Finnish,Japanese,German,Spanish in any
> order
explode() and arr
5 matches
Mail list logo