Results 1 to 5 of 5
Thread: Creating a static array in php
-
09-27-2004 12:08 PM #1ooen Guest
Creating a static array in php
I have a question. How do you create a static array in php?
-
09-27-2004 03:11 PM #2
Senior Member
Array
- Join Date
- Aug 2004
- Location
- Oradea, Romania
- Posts
- 135
Using array() function ? Using sessions? It really depends on what you understand by static array in PHP...
Originally Posted by ooen
--
Alex
Web Hosting & Domain Names UK
Webmaster Forums
Internet Access Web Hosting
-
09-28-2004 12:30 AM #3ooen Guest
This is what I want to do. There is a list of directories that I want to store in an array, but I want to run the routine only once to create the array, and I want to make a static reference so that I can just keep referencing it. How can I do this?
-
09-28-2004 10:45 PM #4
Senior Member
Array
- Join Date
- Aug 2004
- Location
- Oradea, Romania
- Posts
- 135
If you want to run a routine only once to create an array all you have to do is
Originally Posted by ooen
but looking at that article I intend to believe that what you are actually trying to achieve is making "search engine friendly" URLs. If that is the case, these two articles might explain a bit better the subject:Code:if (!isset($my_nice_array)){ // routine to populate the array here... ... }
http://www.sitepoint.com/article/sea...friendly-urls/
http://www.devshed.com/c/a/Apache/Se...h-mod-rewrite/
--
Alex
Web Hosting & Domain Names UK
Webmaster Forums
Internet Access Web Hosting
-
09-29-2004 12:36 AM #5ooen Guest
I actually read both articles while back :) . The problem is that this is not good enough if you want to create descriptive URL strings; this is how I came up with a solution I presented in the paper. However, I didn't know how I can create the array only once in php. Now I know ... Thanks :) .
Similar Threads
-
Parham's PHP Tutorial
By Ardenn in forum Website Programming DiscussionReplies: 15Last Post: 07-19-2012, 10:56 AM -
Simple PHP Template Tutorial
By theomnis in forum Website Programming DiscussionReplies: 9Last Post: 03-27-2012, 07:54 AM -
PHP & PHPBB security
By ealex in forum ComputersReplies: 0Last Post: 11-09-2005, 12:49 PM -
PHP Security: PHPSC Site launched!
By alexandru in forum ComputersReplies: 0Last Post: 02-07-2005, 01:28 PM -
PHP Security <- A MUST READ
By alexandru in forum Website Programming DiscussionReplies: 0Last Post: 01-19-2005, 01:59 PM



LinkBack URL
About LinkBacks
Reply With Quote


Bookmarks