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 ) );?> Link to comment https://forums.phpfreaks.com/topic/115433-solved-array-issues/ 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 Link to comment https://forums.phpfreaks.com/topic/115433-solved-array-issues/#findComment-593418 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 Link to comment https://forums.phpfreaks.com/topic/115433-solved-array-issues/#findComment-593432 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 ) ); Link to comment https://forums.phpfreaks.com/topic/115433-solved-array-issues/#findComment-593439 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 Link to comment https://forums.phpfreaks.com/topic/115433-solved-array-issues/#findComment-593449 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 Link to comment https://forums.phpfreaks.com/topic/115433-solved-array-issues/#findComment-593451 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.