assign array to variables in a loop

this will assign all items in the array to variables $p1,$p2.. etc.
$p = "/1/2/3/4/5/";
$page_array = explode("/",$p);
foreach ($page_array as $key => $value) {
	if($value > "") {
		${"p".$pcount} = $value;


Other Items in php
Page Views

This page has been viewed 113 times.

Search Code
Search Code by entering your search text above.

This is my test area for webdev. I keep a collection of code snippits here, mostly for my reference. Also if i find a good site, i usually add it here.