PHP array

Hi is tehre any way I can reference the next array sequence like so?

I’m trying to create a ‘next’ option which will then be interchangeable depending on the array sequence.

[php]

$function = array(

//Work1
  array(
 
 "link.php",

 "Title"
 
   [b]echo $function[1][1],[/b]

),

//Work2
array(

 "link.php",

 "Title"
 
 [b]  echo $function[2][1],[/b]

),
);
?>
[/php]

Thanks!

What are you trying to do as a whole? I smell an XY Problem.

I want to create an array which contains the title, links etc of projects then I’m going to use that array to generate the data for project pages. If it’s possible to reference I could have a next and previous feature at the end for each project page without the need or creating additional lines in that array.

I don’t think you understood my question. You are still telling me HOW you want to attempt to solve your “problem”. When you say “I want to create an array” you are telling me the how. It is my purpose to decide the how. You need to tell me the what. Think bigger, broader.

Okay then I want an easy way to generate data to the pages without the need of updating each of the pages. The pages need a next and previous area as well.

Much, much better. Where does this data come from? A database?

Thanks. I’ve just started learning PHP/ SQL so manually for now. I’m a designer by trade so it’s for a personal portfolio site

I would suggest you use a database. If you don’t want or need Mysql you can use Sqlite.

Sponsor our Newsletter | Privacy Policy | Terms of Service