Free php scripts

WM Media - Sell Your Website Directory Submission
WL Marketing - a SEO Submission Company
Article Submission
  • Register
  • Login


  • Tutorials/support/References
  • PHP/ASP/PERL Bookstore
  • Community
  • Chat
  • Tutorials
  • Free Smiley Icons
  • Web Hosting

  • Search


    Scripts
  • Chipmunk CMS
  • Forums PHP Script
  • Chipmunk Blogger Script
  • Chipmunk Topsites
  • Chipmunk Addresshost
  • Chipmunk Newsletter
  • Free Guestbook Script
  • Free Poll Script
  • Directory Script
  • Kill Monster
  • Free FFAL script
  • CMS core
  • Chat Room
  • Riddles
  • Random Links
  • Recommend Site
  • Random Quote
  • Story Lines
  • Text Counter
  • Chipmunk Live
  • Chipmunk Bloghost
  • PHP AWS script
  • pwngame
  • Books
  • Begginning PHP4
  • Professional PHP4
  • PHP Cookbook
  • Legal Stuff for scripts
  • Script Liscense


  • Top 5 hottest members
    canuckid
    Mitch
    Tanya
    Decenco
    Chipmunk




    Quality Freelancing


    Sister Sites
  • My Blog
  • Albino Freebies
  • Java gaming
  • Flashninjaclan


  • Premium Affiliates
     
     
    Symbols to Images
    Many people wonder how on php message boards and guestbook you turn and :) into a smiley face icon. This is very easy and this tutorial will show you how in two minutes. Observe the following code:


    <?
    $gbvalues=" :) :( :p ;) ;smirk :blush :angry :o ";
    
    $smilies=array( 
        
        
        ':)' => "<img src='images/smile.gif' />",
    ':(' => "<img src='images/sad.gif' />",
    ':p' => "<img src='images/tongue.gif' />",
    ';)' => "<img src='images/wink.gif' />",
    ';smirk' => "<img src='images/smirk.gif' />",
    ':blush' =>"<img src='images/blush.gif' />",
    ':angry' =>"<img src='images/angry.gif' />",
    ':o'=> "<img src='images/shocked.gif' />"
    ); $gbvalues=str_replace(array_keys($smilies), array_values($smilies), $gbvalues); print "$gbvalues"; ?>



    First I created a string variable called gbvalues(php doesn't define variables so you can put in them whatever type you want) and assigned it a string value. Next, I declared a smilies array. The values on the left side of the => symbol are what the intial characters of the input are. The values on the right but is what they'll be converted into so on the right side I have put html image command to make it display certain images when those combinations of characters on the left side of the => are inputted. Next I call a string replace function. The line

    $gbvalues=str_replace(array_keys($smilies), array_values($smilies), $gbvalues);

    simply replaces the keyboard input on the left side of the => with the values on the right side you have defined. array_keys($smilies) and array_values($smilies) defines the name of the array you have declared to use in converting the symbols to icons. array_keys is the intial keyboard character input and array_values is what they will be converted to. The last parameter passed into the string str_replace function is the name of the variables you want to convert, in this case, gbvalues.

    For Example using the above code(of course editing the image URLs after the img src html command to the URLs of my images) I get this output.

    :) :( :p ;) ;smirk :blush :angry :o

    becomes



    after we use the string replace array function

    Thats all there is to converting keyboard character input into images!

    News Categories
  • Site News
  • Technology news
  • Programming news
  • Other Major News


  • Search Articles


    Make Money
    Free Blog promotion -- Get your blog syndicated on thousands of other blogs for free.

    Tutorial Categories
    Ad Managers(5)
    Calendars(6)
    Chat systems(5)
    CMS systems(7)
    Cookies/Sessions(4)
    Counters(8)
    E-commerce(7)
    File Manipulation(4)
    Forms(10)
    Forums(4)
    Guestbooks(5)
    HTML/CSS Tutorials(12)
    Image-related(5)
    Link indexing/ Classifieds(6)
    Mailing Lists/E-mail(5)
    Misc(17)
    MySQL Related(9)
    Navigation/Templating(6)
    PHP Basics(10)
    Polls(3)
    RSS and other feeds(5)
    Searching(4)
    Security(13)
    XML and other parsing(3)


    Resources
    Scripts/Graphics
  • Ecommerce Website Design
  • Hotscripts
  • Boxedart
  • Zero Web
  • Edorel Free Hosting
  • Javascript Reference
  • Powerful Scripts
  • Scripts Bank
  • Finestzone Designs
  • Layouts 4 free
  • Website Resources
  • 4 templates
  • Free URL redirection
  • Web Hosting
  • Website Hosting
  • Photoshop Tutorials
  • PHP and MYSQL tutorials
  • Free Templates
  • Tutorials DB
  • Pure Graphics
  • Total Tutorials
  • Myspace Pro Designs
  • Texas Electric Service
  • Cirro Energy
  • Reliant Energy Houston


  • Random Affiliates
        
        
        

    More affiliates