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
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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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