# Variables from variables

**URL:** <https://forum.kirupa.com/t/variables-from-variables/148154>\
**Category:** Uncategorized\
**Created:** [May 17, 2005, 1:43pm UTC](https://forum.kirupa.com/t/variables-from-variables/148154 "2005-05-17T13:43:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cybernoid](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@Cybernoid](https://forum.kirupa.com/u/Cybernoid)\
**Post date:** [May 17, 2005, 1:43pm UTC](https://forum.kirupa.com/t/variables-from-variables/148154/1 "2005-05-17T13:43:34Z")

</div>

Is there a way to simplify this? I think there is, but I’m too tired to figure it out…

```php

$array1=array("Header1","Header 2","Header Three");
$some_array=array("Some header","Other header");
$array3=array("Fubar","BarFu","FooBar");
...

	if($page=="array1")
	{
		return $array1[$type];
	}	
	if($page=="some_array")
	{
		return $some_array[$type];
	}	
... 

```

$page and $type are already set.

Thanks.
