title: Best way to store this data in a variable?
body: <p>Some quick background info: I'm coding up a site which matches books to the classes they're required for.</p>
  
  <p>I have two pieces of data that I need to represent in my code-- which books go with which classes, and the data (titles, authors, pricing, etc.) on these books.</p>
  
  <p>Currently I represent this all with two arrays: <code>$classArray</code>, and <code>$Books_data</code>.</p>
  
  <p>The advantage of this approach over a one-variable approach is that I don't repeat myself-- if a Book is required multiple times for different classes, only the ISBN needs to be stored in the <code>$classArray</code> and I can store the data in the <code>$Books_array</code>.  This advantage is especially poignant because I have to query the pricing data from API's on the fly.  If I only had a <code>$classBooksArray</code>, I'd have to loop the query responses into a big array, repeating myself (seemingly) unnecessarily.</p>
  
  <p>The disadvantage of this approach is that these variables follow each other almost everywhere like Siamese twins.  Nearly every function that needs one, needs the other.  And my coding spidey sense tells me it might be unnecessary.</p>
  
  <p>So, what would be the best way to store this data?  Two arrays, one array, or some other approach I haven't mentioned (e.g. passing by reference).</p>