| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Member Join Date: Dec 2004
Posts: 30
![]() | PHP Regexs (I presume) help needed Hey all. Basically what I'm trying to do is take a text string generated from form and take each individual alphanumeric character and replace it with the corrosponding image. So if 'cat' is typed in it displays '<img src="c.gif"><img src="a.gif"><img src="t.gif">. The images would be transparent gifs of the corrosponding letter from a specific font. Is this possible and how might i do it? Thanks. |
| |
| | #2 (permalink) |
| Domains my Dominion Join Date: Aug 2005 Location: Web 1.0
Posts: 9,963
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Well you don't really need a regex here... Basically you need to 'scan' your string one letter at a time - a simple loop will do the job nicely ![]() PHP Code:
__________________ NameNewsletter.com - free lists of available domain names ZoneFiles.net (beta) - ccTLD and gTLD droplists |
| |
| | #3 (permalink) | ||||
| Soon to be RICHdoggie! Join Date: Jan 2005 Location: UK
Posts: 2,408
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | very clever! well done - have been looking for something like this for a long, long time, and just never thought to use substr. I was stuck trying to find a way to use explode! ![]()
| ||||
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Great Scripts for Sale With Resale Rights! | Zeeble | Scripts For Sale | 20 | 01-04-2006 01:39 AM |
| Googlism - What does google think of you? | deadserious | The Break Room | 55 | 12-15-2005 09:09 AM |