New Website

I've made a new website, as lynx.io is dead. You can find it here: http://macr.ae/—it's similar in format to lynx.io, but has better articles, and they're all written by me.

JavaScript disabled

While it will still mostly work, a lot of this site's functionality relies on JavaScript - please enable it for the best experience.

Hello world!

Welcome to lynxphp! I’m Callum Macrae, administrator of lynxphp and a PHP developer. I’ve been around for a while, but I’ve never actually contributed anything to the developer community, so I thought I would start this website to share my knowledge (and to help myself learn new stuff)! I will attempt to provide useful information and tutorials about PHP, in addition to other generic web topics like server management and third-party scripts. I probably won’t be writing any articles about front end development (HTML, CSS, Javascript, etc.) because I much prefer backend development. (Sorry!)

There is one thing I will never teach anyone, and that is how to say “Hello World!”. For a start, I’m going to assume you know the very basics of PHP, and I also only give real-life examples.

Over the next week or so, I will be attempting to publish an article daily. Okay, that’s not quite as impressive as it sounds – I have loads already saved to drafts that I did while I was buying the domain! When I’ve run out of saved articles, I will hopefully be writing about one weekly.

Until next time!

~Callum

UPDATE: Okay, I may have strayed from this a little bit; the site is no longer exclusively about PHP (I'm not even a PHP developer any more). It's not even called lynxphp any more. Updates on this soon…

About Callum Macrae:

Callum Macrae is the founder of lynx.io and a JavaScript developer from the United Kingdom. He is currently writing his first book, to be published by O'Reilly Media.

You can view more articles by this author here.

Tags: news

Comments

Garrett says:
<?php $a = array(0x48,0x65,0x6c,0x6c,0x6f,0x20,0x57,0x6f,0x72,0x6c,0x64,0x21);
foreach ($a as $chr) {
  echo chr($chr);
}

Basic "Hello World!" PHP script, for those of you disappointed by Callum's lack thereof.

Callum Macrae says:

You're doing it wrong!

lib/mysite/controllers/HelloController.php:

<?php
namespace mysite\controllers;

class HelloController
{
    public $a = array();

    public function __construct()
    {
        $this->a = array(0x48,0x65,0x6c,0x6c,0x6f,0x20,0x57,0x6f,0x72,0x6c,0x64,0x21);
    }

    public function sayHello()
    {
        $hello = null;
        foreach ($a as $chr)
        {
            $hello .= chr($chr);
        }
        require(VIEW_PATH . "/hello_world.php");
    }

}

index.php:

<?php
define("VIEW_PATH", __DIR__ . "/views");

require_once(__DIR__ . "/lib/mysite/controllers/HelloController.php");

use mysite\controllers\HelloController;

$site = new HelloController();
$site->sayHello();

views/hello_world.php:

<!DOCTYPE html>
<html>
        <head>
                <title>My Site: <?php echo $hello; ?></title>
        <head>
        <body>
                <h1><?php echo $hello; ?></h1>
        </body>
</html>
says:

Add comment

 

You can use markdown in comments (press "m" for a cheatsheet).

Enable JavaScript to post a comment

Markdown Cheat Sheet

# This is an <h1> tag
## This an <h2> tag
###### This is an <h6> tag

Inline markup: _this text is italic_, **this is bold**, and `code()`.

[Link text](link URL "Optional title")
[Google](http://google.com/ "Google!")

![Alt text](image URL)

![This is a fish](images/fish.jpg)

1. Ordered list item 1
2. Ordered list item 2

* Unordered list item 1
* Unordered list item 2
* Item 2a
* Item 2b

And some code:

// Code is indented by one tab
echo 'Hello world!';

Horizontal rules are done using four or more hyphens:

----

> This is a blockquote

This is an <h1> tag

This an <h2> tag

This is an <h6> tag

Inline markup: this text is italic, this is bold, and code().

Link text Google

This is a fish

  1. Ordered list item 1
  2. Ordered list item 2
  • Unordered list item 1
  • Unordered list item 2
    • Item 2a
    • Item 2b

And some code:

// Code is indented by one tab
echo 'Hello world!';

Horizontal rules are done using four or more hyphens:


This is a blockquote

Toggle MarkDown / HTML (t), full reference or close this