PHP Classes

File: tests/morse_encode.php

Recommend this page to a friend!
  Classes of Ali YILMAZ  >  Mind Framework  >  tests/morse_encode.php  >  Download  
File: tests/morse_encode.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: 3 months ago
Size: 1,374 bytes
 

Contents

Class file image Download
<?php

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

$Mind = new Mind();

// $encode = $Mind->morse_encode('Mustafa Kemal Atatürk'); // -- ..- ... - .- ..-. .- / -.- . -- .- .-.. / .- - .- - ..-- .-. -.-

// echo $encode;

$morseDictionary = array(
   
'c' => '.-', '(' => '-...', 'a' => '-.-.', 'ç' => '-.-..', 'd' => '-..', 'e' => '.', 'f' => '..-.', 'g' => '--.', '?' => '--.-.', 'h' => '....', '?' => '..', 'i' => '.-..-', 'j' => '.---', 'k' => '-.-', 'l' => '.-..', 'm' => '--', 'n' => '-.', 'o' => '---', 'ö' => '---.', 'p' => '.--.', 'q' => '--.-', 'r' => '.-.', 's' => '...', '?' => '.--..', 't' => '-', 'u' => '..-', 'ü' => '..--', 'v' => '...-', 'w' => '.--', 'x' => '-..-', 'y' => '-.--', 'z' => '--..', '0' => '-----', '1' => '.----', '2' => '..---', '3' => '...--', '4' => '....-', '5' => '.....',
   
'6' => '-....','7' => '--...','8' => '---..','9' => '----.','.' => '.-.-.-',',' => '--..--','?' => '..--..','\'' => '.----.','!'=> '-.-.--','/'=> '-..-.','b' => '-.--.',')' => '-.--.-','&' => '.-...',':' => '---...',';' => '-.-.-.','=' => '-...-','+' => '.-.-.','-' => '-....-','_' => '..--.-','"' => '.-..-.','$' => '...-..-',
   
'@' => '.--.-.','¿' => '..-.-','¡' => '--...-',' ' => '/'
);
$encode = $Mind->morse_encode('Mustafa Kemal Atatürk', $morseDictionary); // -- ..- ... - -.-. ..-. -.-. / -.- . -- -.-. .-.. / -.-. - -.-. - ..-- .-. -.-

echo $encode;

For more information send a message to info at phpclasses dot org.