Jump to content

Another variable problem


almightyegg

Recommended Posts

I have lots of variables. The way I get the right one is like: $p$xd$y. Eg. if $x = 1 and $y = 4 it's $p1d4.

 

I have got it to the point where I can get it to p1d4. But that's in another variable "$n = p1d4;" I want to put into an if{ }else{ } if($p1d4 == .. ){ but I can't work out a way to get it in the first place...

 

If anypone can shed some light onto this it'd be great

Link to comment
https://forums.phpfreaks.com/topic/98655-another-variable-problem/
Share on other sites

Sorry I did waffle a bit didn't I? Hmm

 

$p1d1 = o;
$p2d1 = o;
$p3d1 = x;
$p4d1 = x;
$p5d1 = x;
$p6d1 = x;
$p7d1 = x;
$p8d1 = x;
$p9d1 = o;
$p10d1 = x;

 

$n = $y-1;
$n = "$p" . $x . "d" . $n ."";
$s = $y+1;
$s = "$p" . $x . "d" . $s ."";
$e = $x+1;
$e = "$p" . $e . "d" . $y ."";
$w = $x-1;
$w = "$p" . $w . "d" . $y ."";

 

Basically, I want $n to equal $p1d0 - if $x = 1 and $y = 1

 

More sense?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.