PHP Classes

File: tests/is_morse.php

Recommend this page to a friend!
  Classes of Ali YILMAZ   Mind Framework   tests/is_morse.php   Download  
File: tests/is_morse.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Mind Framework
Framework that implements several design patterns
Author: By
Last change:
Date: 2 years ago
Size: 642 bytes
 

Contents

Class file image Download
<?php

require_once '../src/Mind.php';

$Mind = new Mind();

$data = '-- ..- ... - .- ..-. .- / -.- . -- .- .-.. / .- - .- - ..-- .-. -.- / --.-. ..-- .--.. -.-.. ---.';
if(
$Mind->is_morse($data)){
    echo
'It is morse code. ( '.$Mind->morse_decode($data).' )';
} else {
    echo
'It\'s not Morse code.';
}

echo
'<hr>';

$data = '.';
if(!
$Mind->is_morse($data)){
    echo
'It\'s not Morse code.';
} else {
    echo
'It is morse code. ( '.$Mind->morse_decode($data).' )';
}

echo
'<hr>';

$data = 'p';
if(!
$Mind->is_morse($data)){
    echo
'It\'s not Morse code.';
} else {
    echo
'It is morse code. ( '.$Mind->morse_decode($data).' )';
}