Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/08/2024 in all areas

  1. Once again we have no idea what the data you are processing looks like. Post the output from this code... echo '<pre>' . var_export($data, 1) . '</pre>';
    2 points
  2. To understand the code, you should debug what the $words array looks like. The reason the code currently works to sort by occurrence, is because the array looks like this: array ( 'red' => 7, 'mailbox' => 2, ) Barand gave you the answer, but you need to understand what the difference is between the two functions and when to use one vs the other.
    1 point
  3. As mentioned on Discord, if you want wincache because it can cache PHP code, then use opcache instead: it does the same thing, except it's part of the PHP core instead of being some third-party, Windows-only extension.
    1 point
  4. maybe something like this (comments explain my logic. Untested code off the top of my head) <?php // added a 'distinct' clause, just because there's no point in pulling out duplicates $items = odbc_exec($odbc, "SELECT distinct keywords FROM faq WHERE visible = 'true'") or die (odbc_errormsg()); // start my empty string $kwords = ''; while ($detail = odbc_fetch_array($items)){ // I'm assuming database can return more than one result, // so I'm ading them all in a string first $kwords .= " ".$detail['keywords']; } // explode all words into single array $allWords = explode('',$kwords); // get unique words $unique = array_unique($allWords); // show me echo '<pre>'; print_r($unique); echo '</pre>'; ?>
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.