Results 1 to 10 of 10
-
7th Jun 2010, 03:17 AM #1OPMemberWebsite's:
litewarez.net litewarez.com triniwarez.comA small tip in PHP
Thought i would share a small tip with you about php that not many people know.
Create a file called config.php
and in that file place the following.
PHP Code:return array(
'db' => array(
'host' => 'litewarez.com',
'user' => 'usr'
//ETC
),
);
PHP Code:$config = include 'config.php';
echo $config['db']['host']; // litewarez.com
litewarez Reviewed by litewarez on . A small tip in PHP Thought i would share a small tip with you about php that not many people know. Create a file called config.php and in that file place the following. return array( 'db' => array( 'host' => 'litewarez.com', Rating: 5Join Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
-
7th Jun 2010, 03:22 AM #2MemberWebsite's:
Rapidleech.com FullMaza.com WarezOcean.com MediaFireForum.comNah i knew that.
btw thanks for the tip. Starters will surely take benefit from this tip.
-
7th Jun 2010, 03:46 AM #3Respected DeveloperWebsite's:
wrzc.orgI used it before. Here's one pratical example from php.net I based something on a while back.
PHP Code:<?php
//EXAMPLE of Multi-Dimentional Array where as an array's keys are an array itself.
//It's so easy to create one like this.
$movie_to_watch = array ('Action'=>
array('Kanu Reeves' => 'Matrix Reloaded',
'Pearce Brosnan' => 'Die Another Day',
'Tom Cruz' => 'Mission Impossible',
'Jason Statham' => 'Crank',
'Danzel Washington' => 'Man on Fire'),
'Comedy' =>
array ('Charlie Chaplin' => 'City Lights',
'Jim Carrey' => 'Cable Guy',
'Rowan Atkinson' => 'The Ultimate Disaster'));
$type_wanted = 'Action'; //You may switch type from Action to Comedy.
$hero_wanted = 'Pearce Brosnan'; // You may switch hero from Pearce Brosnan to Jim Carrey.
print ("$hero_wanted 's $type_wanted movie is " . $movie_to_watch[$type_wanted][$hero_wanted].".");
// produces browser output as under:
// Pearce Brosnan 's Action movie is Die Another Day.
?>Tutorial How to SEO your Warez Site a guide to help you increase your organic traffic
Huge list of Warez Sites and free Multiposter Templates
-
7th Jun 2010, 04:09 AM #4Member
Nice tip mate I didn't know this and it is certainly going to be helpful.
A life spent making mistakes is not only more honorable, but more useful than a life spent doing nothing. ? George Bernard Shaw
?
Designer. Check my designs here.
-
7th Jun 2010, 05:49 AM #5MemberWebsite's:
LulzIMG.com chtbx.com RapidPremium.Net ReleaseLeech.com RLSLeech.com NinjaRobotPirateZombieNazi.comThanks for this. I knew about it too but still needed a good example of implementation.
-
7th Jun 2010, 07:17 AM #6BannedWebsite's:
sbanime.comHow to get PR1?
Well,
My site is1 month oldnow today and its 640K rank on alexa...
Hmm...I would like to know when willit be pr1
-
7th Jun 2010, 08:29 AM #7Member
-
7th Jun 2010, 08:40 AM #8Respected DeveloperWebsite's:
PlatinumW.org NexusDDL.com HD-United.org CheckLinks.org FLVD.orgWow php is full of surprises
Current projects:
Megaupload Premium Multifetch Script | FF Plugin: Tinypic and Imagevenue Image Remoter
Projects in hiatus:
IPB Linkchecker Bot | VB Linkchecker Bot
-
7th Jun 2010, 01:45 PM #9OPMemberWebsite's:
litewarez.net litewarez.com triniwarez.comYea the tip is creating a php file that returns an array you can then use $variable = include 'some file.php';
And yea this is a multidimensional array lolJoin Litewarez.net today and become apart of the community.
Unique | Clean | Advanced (All with you in mind)
Downloads | Webmasters
Notifications,Forum,Chat,Community all at Litewarez Webmasters
-
7th Jun 2010, 03:28 PM #10(╯?□?)╯︵ ┻━┻Website's:
Xenu.ws WarezLinkers.com SerialSurf.com CracksDirect.comReturning inclusions can be useful sometimes but in the case of a config file I am unsure.
I'd definately consider it for some kind of array which, for some reason, I want to constantly name differently.Projects:
WCDDL - The Professional DDL Script
Top Secret Project: In Development - ZOMG
ImgTrack - Never Have Dead Images Again!
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
OS for a small VPS
By RNBxBeatz in forum Server ManagementReplies: 11Last Post: 31st Aug 2011, 03:19 AM -
Need Small help with a Small JS code
By Netguy in forum Web Development AreaReplies: 2Last Post: 5th Nov 2010, 10:08 AM -
Small Bug?
By DeLeTeD in forum Feedback and SuggestionsReplies: 8Last Post: 9th Oct 2010, 08:16 AM -
What's with the small i's?
By Gempis in forum General DiscussionReplies: 14Last Post: 30th Jun 2010, 06:05 PM -
Small GFX Help
By Cooper in forum Community CooperativeReplies: 0Last Post: 19th Apr 2010, 09:52 PM
themaCreator - create posts from...
Version 3.24 released. Open older version (or...