BLHTML.org

BLHTML.org / Web Programming / BLHTML / BLHTML Manual / BLHTML funktion list / BLHTML funktion list /

 
  STR 5650 1
#STR# is an independent function
Rights to use this function #STR#:
  • Admin, type=delfile/tofile/fromfile
  • BASIC

  • #STR# manage and manipulerar strings

    values:  defaults:  description:
    valueString som skall edited value(Text string) / value(array[+])
    type tophparray
    fromphparray

    chr
    asc
    len

    noexe
    exe
    html
    txt
    upper
    lower
    names

    convert






    select

    replace
    pos

    md5
    rot13
    crypt
    password





    mirror
    rnd

    word
    shuffle
    inv
    sort

    echo


    smily

    delfile
    tofile
    fromfile
    #$blhtmlarray[+](NULL ONE TWO)##STR array=blhtmlarray type=tophparray return=tophp#
    #STR value(array(0 => 'NULL', 1 => 'ONE', 2 => 'TWO')) type=fromphparray return=toblhtml#

    Omvandla ASCii to character PHP: chr
    Omvandla character to ASCii PHP: ord
    Returnerar amount characters in string PHP: strlen

    Exekverar inte BLHTML variables, vid utskrift show variables and BLHTML functions
    Exekverar BLHTML, variables
    Konverterar string to html specialcharacters PHP: htmlentities
    Konverterar back html specialcharacters to characters PHP: html_entity
    Gör string to VERSALER PHP: strtoupper
    Gör string to gemener PHP: strtolower
    Gör string to gemener and varje ord börjar with en VERSAL

    convert Konverterar olika characters in dokument for att kunna användas for olika ändamål.
    format använder följande bitar:
    format=1 insert <br> for varje radbyte
    format=2 change ut all < > to #<# #>#
    format=4 change ut all # to #+#
    format=8 change ut all ' and " to #,# and #,,#

    select sätter from=0 and to=NULL som standard.
    Returnerar string from=from to=to from value PHP: substr
    Change ut from="string" in value="Orginal string" to="to" PHP: str_replace
    Returnerar position get=from value PHP: strpos

    Returnerar string/fils checksumma PHP: md5
    Roterar bokstäver A to Z, 13 steg in alfabetet PHP: str_rot13
    Krypterar string to standard Unix DES-baserad kryptering PHP: crypt
    Create a slumpmässig string.
    len=8 sätter längden on den slumpmässiga string
    format=0 Create a string with only VERSALER
    format=1 Create a string with VERSALER and gemener
    format=2 Create a string with VERSALER, gemener and siffror

    Inverterar bokstäverna in value(!gnärts ne rä atteD)
    Blandar ordningen on bokstäver from value

    word plockar ut field no=0 from value(array[+]) field
    Blandar ordningen on value(array[+]) field PHP: shuffle
    Inverterar ordningen on value(array[+]) field
    Sorterar "natural order" ordning on value(array[+]) field PHP: natsort

    Skickar value direkt to webpage, används for felsökning of kod,
    or to write above webpage.

    Konverterar: ":) ;) :D :'( :( :| : >:(" to smilysar

    type=delfile name=filename delete include/filename
    type=tofile name=filename value(Writes text to fil) mode=w mode table: PHP: fopen
    type=fromfile name=filename läser from fil. blhtml=on BLHTML executes contents from filen
    blhtmlblhtml=on BLHTML executes value
    returnreturn=variable stores the results in $variable

    exe, noexe and blhtml:
    #$picture=4#
    #$page=A#
    #STR value(#$picture id=1#) type=exe blhtml=on#<br>          // Exekverar variables, BLHTML
    #STR value(#+#$picture id=1#+#) blhtml=on type=exe#<br>          // Exekverar BLHTML, variables


    // Exekverar variables, BLHTML
    Länk: #STR value(#$page id=1#) blhtml=on#<br>

    // Exekverar nothing
    #STR type=noexe value(#$var=1#(#SUM value($var)#)(#$var#)($var))#"<br>
    // Exekverar BLHTML
    "#STR type=noexe value(#$var=2#(#SUM value($var)#)(#$var#)($var)) blhtml=on#"<br>
    // Exekverar variables, BLHTML
    "#STR value(#$var=8#(#SUM value($var)#)(#$var#)($var)) blhtml=on#"

    Returns:
    BLHTML
    #4 id=1#
    Länk: BLHTML.org
    "#$var=1#(#SUM value($var)#)(#$var#)($var)"
    "(2)(2)($var)"
    "(8)(8)(8)"

    String management with fil:
    // Create: include/test.log for läs and skriv

    #$file=test.log#
    #$s(Write one line to file: <b>$file</b><br>
    )#


    // #STR type=tofile value=$s name=$file# // Create a ny: test.log
    #STR type=tofile value=$s name=$file mode=a+#
    // Add value to file: $file

    Print from file:<br>
    #STR type=fromfile name=$file#
    // #STR type=delfile name=$file# // Delete fil: $file

    Returns:
    Print from file:
    Write one line to file: test

    Att skapa en string and kunna change variablesna in string:
    #$no(one two)#

    #STR type=noexe value(the string: $no) return=echo#

    1: #$echo#<br>
    1: #STR type=exe value=$echo#<br><br>

    #$no(ett två)#

    2: #$echo#<br>
    2: #STR type=exe value=$echo#

    Returns:
    1: the string: $no
    1: the string: one two

    2: the string: $no
    2: the string: ett två

    Slumpa/invertera strings:
    #$str(one two three four five)# // Create a string

    #STR type=password#<br>
    #STR type=rnd value(ABCDE)#<br>
    #STR type=mirror value=$str return=str#
    str: #$str#

    Returns:
    0d3G0y2S
    BAECD
    str: evif ruof eerht owt eno

    Example: type=smily:
    #$smile=":);):D:'(smily example:(:|:\>:("#

    #$smile#
    <br>
    #STR type=smily value=$smile#

    Returns:
    :);):D:'(smily example:(:|:>:(
    happyblinkjoycrysmily examplesadwhat:angry

    Invertera, slumpa and sortera arrayer:
    #$str[+](one two three four five)# // Create a array

    // Function STR executes fler än en subfunktion: mirror and inv
    #STR type(mirror inv) value($str[+] six seven eight) return(str2[+])# // Returnerar outcome to a new array $str2
    (mirror inv) in new array: #$str2[+]#<br>

    sort: #STR type=sort value($str2[+] 'NINE 9' "10 TEN" (11 ELEVEN) TWELVE)#

    Returns:
    (mirror inv) in new array: thgie neves xis evif ruof eerht owt eno
    sort: thgie neves xis evif ruof eerht owt eno 'NINE 9' "10 TEN" (11 ELEVEN) TWELVE

    More information:
  • #STR# example
  • #SUM# counting numbers and variables
  • Show Error details
  • #ARRAY#
  • Array handling
  •   STR example 1062 0
    String management:
    #$A=A#
    asc A=#STR type=asc value=$A#<br>
    chr 88=#STR type=chr value=88#<br><br>

    #$I(I love u)#
    #$I#=#STR type=len value=$I#
    <br>
    word[1]=#STR type=word no=1 value=$I#<br><br>

    Example taken from PHP substr:<br>
    #$str(abcdef)#
    from=1: #STR type=select from=1 value=$str#<br>
    from=0 to=2: #STR type=select to=2 value=$str#<br><br>

    from=1 to=3: #STR type=select from=1 to=3 value=$str#<br>
    from=0 to=4: #STR type=select to=4 value=$str#<br>
    from=0 to=8: #STR type=select from=0 to=8 value=$str#<br>
    from=-1 to=1: #STR type=select from=-1 value=$str#<br><br>

    #STR type=upper value=$str return=b#
    upper: #$b#<br>
    lower: #STR type=lower value=$b#<br>
    names kALLE aNKA: #STR type=names value(kALLE aNKA)#<br><br>

    #$Girl(I love Luna)#
    Girl: #$Girl#<br>
    #STR type=replace from=Luna to=Jaana value=$Girl return=NewGirl#
    NewGirl: #$NewGirl#<br>
    len: #STR type=len value=$NewGirl#<br>
    pos Love: #STR type=pos get=love value=$NewGirl#<br><br>

    #STR type=rot13 value=$Girl return=Girl#
    Girl rot13: #$Girl#<br>
    #STR type=rot13 value=$Girl return=Girl#
    Girl rot13 back: #$Girl#<br>
    #STR type=crypt value=$Girl return=Girl#
    Girl is crypted: #$Girl#<br><br>

    #STR type=html value(<b>this if fat 'strange' letters "åäö"</b>) return=special#
    show html: #$special#<br>
    Back to html text: #STR type=txt value=$special#

    Returns:
    asc A=65
    chr 88=X

    I love u=8
    word[1]=love

    Example taken from PHP substr:
    from=1 to=1: bcdef
    from=0 to=2: ab

    from=1 to=3: bcd
    from=0 to=4: abcd
    from=0 to=8: abcdef
    from=-1 to=1: f

    upper: ABCDEF
    lower: abcdef
    names kALLE aNKA: Kalle Anka

    Girl: I love Luna
    NewGirl: I love Jaana
    len: 12
    pos Love: 2

    Girl rot13: V ybir Yhan
    Girl rot13 back: I love Luna
    Girl is crypted: $1$PmIkL8z4$WZ.zxQp/DHvAo65Qfjfnv0

    show html: this if fat 'strange' letters "åäö"
    Back to html text: this if fat 'strange' letters "åäö"

    More information:
  • #STR#
  • BLHTML forum  


    apache MySQL PHP No to software patents! BLHTML
    © 2003, 2010 BLHTML
    This page is created with BLHTML in 0.2332 seconds