dubc07 Posted July 18, 2008 Share Posted July 18, 2008 Is there anyway of putting the following into a variable? <?php 1 => array( 1200 => array( "html" => "<b>Hello</b><br>Solo", // Display 'Phsychology: Room 404' "style" => "background-color: #FFCC00", // use style property to change the background color "interval" => 0 // set the interval for 2hrs ),?> I have to keep the Arrow => intact so that it can me recognized by classes_arr. <?php $classes_arr = array( 1 => array( // Adds a class at 12pm (1200 hours) 1200 => array( "html" => "<b>Hello</b><br>Solo", // Display 'Phsychology: Room 404' "style" => "background-color: #FFCC00", // use style property to change the background color "interval" => 0 // set the interval for 2hrs ), ) );?> This is what i would like it to look like. <?php $echovalue = 1 => array( // Adds a class at 12pm (1200 hours) 1200 => array( "html" => "<b>Hello</b><br>Solo", // Display 'Phsychology: Room 404' "style" => "background-color: #FFCC00", // use style property to change the background color "interval" => 0 // set the interval for 2hrs ), $classes_arr = array( $echovalue ) );?> Quote Link to comment Share on other sites More sharing options...
craygo Posted July 18, 2008 Share Posted July 18, 2008 Not sure I get what you want. Do you want a certain part of the array to be assigned to $classes_arr or just one values from the $echovalue array?? Ray Quote Link to comment Share on other sites More sharing options...
dubc07 Posted July 18, 2008 Author Share Posted July 18, 2008 What I'm needing is to put it into a variable so that classes_arr can read the whole content of the array. <?php 1 => array( // Adds a class at 12pm (1200 hours) 1200 => array( "html" => "<b>Hello</b><br>Solo", // Display 'Phsychology: Room 404' "style" => "background-color: #FFCC00", // use style property to change the background color "interval" => 0 // set the interval for 2hrs ), INTO <?php $echovalue = 1 => array( // Adds a class at 12pm (1200 hours) 1200 => array( "html" => "<b>Hello</b><br>Solo", // Display 'Phsychology: Room 404' "style" => "background-color: #FFCC00", // use style property to change the background color "interval" => 0 // set the interval for 2hrs ),?> with the => intact. Because i can get the $echovale to put the content's into an array but when i run the script i get a unexpected T_DOUBLE_ARROW. Here is the link to what I'm Trying to do but im wanting to pull from a mysql data base to add more users the the schedule http://x.crabtreeaircraft.com/nutts.php Quote Link to comment Share on other sites More sharing options...
JonnyThunder Posted July 18, 2008 Share Posted July 18, 2008 like this? $classes_arr[1] = array( // Adds a class at 12pm (1200 hours) 1200 => array( "html" => "<b>Hello</b><br>Solo", // Display 'Phsychology: Room 404' "style" => "background-color: #FFCC00", // use style property to change the background color "interval" => 0 // set the interval for 2hrs ) ); Quote Link to comment Share on other sites More sharing options...
craygo Posted July 18, 2008 Share Posted July 18, 2008 <?php $classes_arr[1] = array( // Adds a class at 12pm (1200 hours) 1200 => array( "html" => "<b>Hello</b><br>Solo", // Display 'Phsychology: Room 404' "style" => "background-color: #FFCC00", // use style property to change the background color "interval" => 0 // set the interval for 2hrs ), ?> Ray EDIT: damn phone calls Quote Link to comment Share on other sites More sharing options...
dubc07 Posted July 18, 2008 Author Share Posted July 18, 2008 That's it for now THANKS A Bunch Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.