Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90942235
hello_world.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Nov 6, 06:20
Size
812 B
Mime Type
text/x-php
Expires
Fri, Nov 8, 06:20 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
22164430
Attached To
rPH Phabricator
hello_world.php
View Options
<?php
/* UTF-8 convert to FIGlet Unicode */
/* iconv PHP module required */
function
utf8tofiglet
(
$str
)
{
// escape %u
$str
=
str_replace
(
'%u'
,
sprintf
(
'%%%%u%04X'
,
ord
(
'u'
)),
$str
);
if
(
function_exists
(
'iconv'
))
{
$str
=
iconv
(
'utf-8'
,
'ucs-2be'
,
$str
);
$out
=
''
;
for
(
$i
=
0
,
$len
=
strlen
(
$str
);
$i
<
$len
;
$i
++)
{
$code
=
ord
(
$str
[
$i
++])
*
256
+
ord
(
$str
[
$i
]);
$out
.=
$code
<
128
?
$str
[
$i
]
:
sprintf
(
'%%u%04X'
,
$code
);
}
return
$out
;
}
return
$str
;
}
require_once
'Text/Figlet.php'
;
$figlet
=
new
Text_Figlet
();
$error
=
$figlet
->
LoadFont
(
'makisupa.flf'
);
if
(
PEAR
::
isError
(
$error
))
{
echo
'Error: '
.
$error
->
getMessage
()
.
"
\n
"
;
}
else
{
echo
$figlet
->
LineEcho
(
utf8tofiglet
(
'Hello, world!'
))
.
"
\n
"
;
}
?>
Event Timeline
Log In to Comment