Hello and thanks for reading my post.
I want to pass an array from one function to another however the trick I guess is the array needs to be evaluated or something?
This other function is a wysiwyg editor and I can hard code predefined links that work in it's popup for fast website links.
If I hard code in this function the following
$editor->set_links(array(
array('0', '/demos.htm', 'Demos'),
array('0', '/features.htm', 'Features'),
array('0', '/index.asp', 'Home'),
array('0', '/Orders/OrderPage.asp', 'Order'),
array('0', '/requirements.htm', 'Requirements'),
array('0', '/support/index.htm', 'Support'),
array('1', '/support/LanguageDL.asp', 'Language Files'),
array('1', '/support/manuals.php', 'Manuals'),
array('1', '/xForum/default.asp?Group=5', 'Support Forum'),
array('1', '/support/updates.php', 'Updates'),
));
The editor pop up shows all the links just fine so I though wow if I can do this maybe I can make it dynamic so I created a seperate function
FUNCTION linkArray ( $word )
{
$select = '* ';
$where = "`word_title` LIKE '" . sqlesc($word) . "%' ";
$order = "`word_title` ASC ";
$q = "SELECT $select FROM `sw_dictionary_words` WHERE $where ORDER BY $order ";
$res = db_res( $q );
WHILE ( $row = mysql_fetch_assoc( $res ) ) {
$Word = str_replace(' ', '_', htmlesc($row['word_title'] ) );
$MyLinkArra .= array('0', "{$Word}.html", "{$row['word_title']}");
$MyLinkArra .= ",";
}
RETURN array($MyLinkArra);
}
Now what I want to do is pass the return value to the editor like this
$editor->set_links( linkArray ( $word ) );
But of course this doesn't seem to work, can anyone see what I'm doing wrong or is this not possible