We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
  • Pages:
  • 1
  • 6
Who know PhP?
Topic Started: Feb 23 2005, 08:28 PM (2,515 Views)
Zach
Member Avatar
Missjayness
[ *  *  *  *  * ]
Yea, I learned this reading Hudzilla's e-book on PHP. it's great so far.
Offline Profile Quote Post Goto Top
 
Cool Dude 2k
<?php echo "Linux"; ?>
[ *  * ]
Seth
February 28, 2005 08:37 AM
Yep, take this:

$type = "basket";

echo("I like $typeball");

Will look for a variable called typeball. So you have to use

echo("I like {$type}ball");

To delimit the variable ^_^

:o Thats Cool I would have done this.
Code:
 
echo("I like ".$type."ball");

But thanks for the help seth. B)
Offline Profile Quote Post Goto Top
 
Boles Roor
("\';,,,;'/")™
[ *  *  *  *  * ]
Code:
 
<?php
$show = 2;
$php[] = "Wewt";
$php[] = "I don't know PHP.. Nah";
$php[] = "Pie is goowd";

srand ((float) microtime() * 10000000);
$Keys = array_rand($php, 2);

for($K = 0; $K < $show; $K++)
{
echo "".$php[$Keys[$K]]." ";
}
?>


Wewt Pie is goowd
Offline Profile Quote Post Goto Top
 
The Legendary Sam
Feck j00, mate!
[ *  *  * ]
Code:
 

<?php

$myVar = '.';

echo ".{$myVar}.";

?>


...
Offline Profile Quote Post Goto Top
 
Seth
Member Avatar
I has a pony
[ *  *  *  *  *  *  *  *  * ]
<?php

function pat_you_on_head($who) {
echo ("Seth pats $who on the head ^_^");
}

pat_you_on_head('sammeh');

?>

:rofl:
Offline Profile Quote Post Goto Top
 
The Legendary Sam
Feck j00, mate!
[ *  *  * ]
Code:
 

<?php

$myVar = 'sig';
$mySecvar = 'coolness';
$tehName = 'Seth';

echo "Look at teh {$myVar}, {$tehName}, it is teh {$mySecvar}.";

?>


:D
Offline Profile Quote Post Goto Top
 
eXaulz
GU˛ Services; Support Manager
[ *  * ]
Code:
 

<?php

$iF = new iF();

switch ($_GET['a']) {

      case 'administrators':

             $iF->listAdministartors();

      break;

      default:

             echo '<a href="?a=administartors">Show Administrators</a> <br />';

}

class iF {
       
      var $administrators = 'Duffman, Seth, Brian, Lightsup55';


      function listAdministrators() {

             $adminList = explode(", ", $this->administrators);

             echo $adminList[0] . $adminList[1] . $adminList[2] . $adminList[3];

      }

}

?>


Wee... Hmm, I'm bored. So, I just used a simple explode() function.
Offline Profile Quote Post Goto Top
 
Seth
Member Avatar
I has a pony
[ *  *  *  *  *  *  *  *  * ]
The Legendary Sam
March 3, 2005 09:08 PM
Code:
 

<?php

$myVar = 'sig';
$mySecvar = 'coolness';
$tehName = 'Seth';

echo "Look at teh {$myVar}, {$tehName}, it is teh {$mySecvar}.";

?>


:D

Code:
 

<?php
$sig = look_at_sig('sam');
switch ($sig) {

case 'cool':
echo('Cool ^_^');
break;

case 'scary':
echo('Ack O_O');
break;

default:
echo(':ermm:');
}
?>

Output
 
Ack O_O
Offline Profile Quote Post Goto Top
 
SargeTron
Unregistered

Code:
 
<?php
$connect = mysql_connect('ultra-leet-host-mysql.com', 'leet-owner-dude', 'youllnevergetintomypassfooet98yu76atdfkj4h87gyfgjtg') or die('oh damn it didnt work'); mysql_select_db('wootdata');
$get_teh_data = mysql_query('SELECT * FROM leetsecretfiles');
while ($lol = mysql_fetch_array($get_teh_data))
{
$handle = fopen('cool_text_1.txt', 'w') or die("sowwy");
fwrite("Heheh, look: {$lol}, that's the current data.", $handle) or die('noes');
fclose($handle);
}
mysql_close($connect);
?>
...w00t
Quote Post Goto Top
 
mathiaus
Member Avatar
mathiaus maximus™
[ *  *  *  *  *  * ]
<?php
if ($SargeTron=="showing off")
echo "Show off";
?>
Offline Profile Quote Post Goto Top
 
SkItZo
Support Volunteer
[ *  *  * ]
<?
if($SargeTron['showoff'] == "Yes")
echo "What a show off";
}
else
{
echo "What a poser";
?>

don't hound me if that code up-top doesnt work, ill ignore u
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Technology Chat · Next Topic »
Add Reply
  • Pages:
  • 1
  • 6