![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Join Date: Jul 2006
Location: NoHo
Posts: 5,970
|
Need Some Quick PHP Help...PHP Gurus Inside!
So I have an array like this:
PHP Code:
I need something like this (don't know if this is even possible when it comes to arrays): PHP Code:
__________________
![]() ICQ: 266990876
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
|
you need to do a multi-dimensional array
$dic = array( "interger1 " => array( "intergerA" => "value", "intergerB" => "value", "intergerC" => "value" ), "interger2 " => array( "intergerA" => "value", "intergerB" => "value", "intergerC" => "value" ), "interger3 " => array( "intergerA" => "value", "intergerB" => "value", "intergerC" => "value" )); then shuffle(); edit: good chance i fucked that code up because im half asleep, but you'll get the idea im sure.
__________________
Mechanical Bunny Media Mechbunny Tube Script | Mechbunny Webcam Aggregator Script | Custom Web Development |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Dec 2002
Location: Behind the scenes
Posts: 5,190
|
use array_rand()
say you have $pick = array('integerA', 'integerB', 'integerC'); then use with your $dic = array( 'integer1'=>array_rand($pick), 'integer2'=>array_rand($pick), ... ); hope this helps
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Dec 2002
Location: Behind the scenes
Posts: 5,190
|
i think i'm a bit off as i didn't quite get what you wanted pull randomly, but you get the idea..
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
Confirmed User
Join Date: Jul 2006
Location: NoHo
Posts: 5,970
|
Quote:
![]()
__________________
![]() ICQ: 266990876
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Confirmed User
Join Date: Jul 2006
Location: NoHo
Posts: 5,970
|
Quote:
IF integer1 is found it shoud pick 1 of 3+ values and assign it to it... the script should asign a value to each integer element so: integer2, integer3, integer4 will also be assigned a value..
__________________
![]() ICQ: 266990876
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Industry Role:
Join Date: Dec 2002
Location: Behind the scenes
Posts: 5,190
|
yeah, then do them multidimentional as k0nr4d said and then use shufle or array_rand to pick random value for required integer
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |