Jump to content

tHud

Members
  • Posts

    93
  • Joined

  • Last visited

Profile Information

  • Gender
    Female

tHud's Achievements

Member

Member (2/5)

0

Reputation

  1. Oh thank you so much ginerjm, I'm always overthinking things! I really appreciate your help. @benanamen - Thank you for your input. I am aware of this, it's not my code. I only saw it today for the first time.
  2. I'm sorry, this is the code. $query = "SELECT assignTable FROM EXHIBITORS WHERE year = $newYear"; $result = $mysqli->query($query) or die("There was a problem with the query: " . mysqli_error($mysqli)); if ($result->num_rows > 0) { while($row = $result->fetch_assoc()) {$myResults[] = $row; } } $myVals = array_column($myResults, 'assignTable'); echo '<pre>'; print_r($myVals); echo '</pre>'; I've been asked to alter some code of a guy that left the company.
  3. Hello everyone I have an array like this... Array ( [0] => A27 [1] => A25+A26 [2] => B1 [3] => B7 [4] => C10 [5] => A3 [6] => B5 [7] => C1+C2 [8] => A1 [9] => A6 [10] => C8 [11] => A12 [12] => C14 [13] => A15 [14] => C11 [15] => B3+B4 ) I would like to remove the values after the + sign and replace the second part back in the array. Something like this... Array ( [0] => A27 [1] => A25 [2] => B1 [3] => B7 [4] => C10 [5] => A3 [6] => B5 [7] => C1 [8] => A1 [9] => A6 [10] => C8 [11] => A12 [12] => C14 [13] => A15 [14] => C11 [15] => B3 [16] => A26 [17] => C2 [18] => B4 ) I think I've been away from PHP too long because I've tried all sorts of ways of doing this and I am really stuck. Thank you for any suggestions.
×
×
  • 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.