Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 715 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

Just starting to learn

Thread title: Just starting to learn
Closed Thread  
Page 4 of 4 < 1 2 3 4
    Thread tools Search this thread Display Modes  
08-07-2004, 02:37 PM
#31
sliceandcode is offline sliceandcode
Status: Request a custom title
Join date: Aug 2004
Location: California
Expertise:
Software:
 
Posts: 1,004
iTrader: 0 / 0%
 

sliceandcode is on a distinguished road

  Old

lol stoavio.. I tried doing a PHP tutorial and all I remember is Notepad and Hello World

08-07-2004, 05:57 PM
#32
Salathe is offline Salathe
Salathe's Avatar
Status: Community Archaeologist
Join date: Jul 2004
Location: Scotland
Expertise: Software Development
Software: vim, PHP
 
Posts: 3,820
iTrader: 25 / 100%
 

Salathe will become famous soon enough

Send a message via MSN to Salathe

  Old

Try this.
PHP Code:
<?php
/**
 * A simple remake of the ever-popular
 * "Hello World" application.
 *
 * Copyright 2004 Peter Cowburn <peter@cowburn.info>
 * You are free to modify, add-to and redistribute without my
 * written consent.  All I ask is that you acknowledge me as the
 * original author.
 */

Class HelloWorld
// Class for our HelloWorld Script
{
    
// Key holder
    
var $def_key = array();
    
    Function 
key($string)
    
// Work with our key
    
{
        
$temp = array();
        for (
$i=0$i<strlen($string); $i++)
        {
            
$temp[] = ord($string{$i}) - 97;
        }
        
$this->def_key $temp;
        return 
true;
    }
    
    Function 
clarify($input$key=null)
    
// Simple, it clarifies a string
    
{
        if (
$key === null)
        {
            
$key $this->def_key;
        }
        
$temp = array();
        for (
$i=0$i<count($key); $i++)
        {
            
$temp[$this->def_key[$i]] = str_rot13($input{$i});
        }
        
ksort($temp);
        
$temp join($temp'');
        return 
$temp;
        
// confused yet?
    
// Function clarify
    
//Class HelloWorld

/*
    **********
    Right, that's the Class over with.
    Now for the procedural elements.
    **********
*/

// Lets create the 'word' and 'key' variables
$word     'ybUq !ybJrey';
$key     'kfblgmeihcjd';

// Create a new instance of the HelloWorld class
$hello     = new HelloWorld;
// Play with a 'key' string
$hello->key($key);

// And call the clarify method of our HelloWorld object
$result $hello->clarify($word);

// Echo the result!
echo $result;

// The end
exit;
?>
- Salathe

08-10-2004, 03:37 AM
#33
stoavio is offline stoavio
stoavio's Avatar
Status: Member
Join date: Jul 2004
Location:
Expertise:
Software:
 
Posts: 237
iTrader: 0 / 0%
 

stoavio is on a distinguished road

Send a message via AIM to stoavio Send a message via MSN to stoavio

  Old

Originally Posted by Nightspy
lol stoavio.. I tried doing a PHP tutorial and all I remember is Notepad and Hello World
Yep, same here.

Closed Thread  
Page 4 of 4 < 1 2 3 4


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed