Jump to content

[SOLVED] Array Issues


dubc07

Recommended Posts

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

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

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

<?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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.