Web Design Forum: PHP Noob Question :$ - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

PHP Noob Question :$ Changing The Letters Typed In. Rate Topic: -----

#1 User is offline   Stripes-_-B3llatr1x 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 20
  • Joined: 28-July 11
  • Reputation: 0

Posted 20 December 2011 - 03:10 AM

I Want To Make A File That I Can Change What Each Value Of The Keyboard Is... So Like Changing "L" To "☺" Or "T" To "♦", Etc... I Would Want This To Do So On Every Element On The Page. I Know It'd Work For All Text Boxes, But I'm Not So Sure If It'd Work For Elements Coded In Flash? (Which Is What I'm Trying To Do) All Help Is Appreciated - Thanks!!!
0

#2 User is offline   Stripes-_-B3llatr1x 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 20
  • Joined: 28-July 11
  • Reputation: 0

Posted 25 December 2011 - 11:34 PM

View PostStripes-_-B3llatr1x, on 20 December 2011 - 03:10 AM, said:

I Want To Make A File That I Can Change What Each Value Of The Keyboard Is... So Like Changing "L" To "☺" Or "T" To "♦", Etc... I Would Want This To Do So On Every Element On The Page. I Know It'd Work For All Text Boxes, But I'm Not So Sure If It'd Work For Elements Coded In Flash? (Which Is What I'm Trying To Do) All Help Is Appreciated - Thanks!!!



Bump!
0

#3 User is online   kensha 

  • Expert
  • PipPipPipPip
  • Group: Members
  • Posts: 870
  • Joined: 12-August 10
  • Reputation: 17
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 25 December 2011 - 11:43 PM

That is something for Javascript.
You should be able to create a script with the letter code to change it functions.

But why would you actually want to do that?
0

#4 User is offline   Stripes-_-B3llatr1x 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 20
  • Joined: 28-July 11
  • Reputation: 0

Posted 26 December 2011 - 02:17 AM

View Postkensha, on 25 December 2011 - 11:43 PM, said:

That is something for Javascript.
You should be able to create a script with the letter code to change it functions.

But why would you actually want to do that?


Personal Reasons. So Can You Help? Or Is That All You're Going To Do? I Know This Can Be Done In PHP Too, Which Is What I'm Going For...

This post has been edited by Stripes-_-B3llatr1x: 26 December 2011 - 02:18 AM

0

#5 User is offline   Samus 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 367
  • Joined: 05-August 11
  • Reputation: 27
  • Gender:Male
  • Location:Hackney, London, UK
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 26 December 2011 - 09:00 PM

View PostStripes-_-B3llatr1x, on 26 December 2011 - 02:17 AM, said:

So Can You Help? Or Is That All You're Going To Do?

That sounds abit rude..

Anyway, you could use the PHP function str_replace().

Something like..

<?php
$string = "I love Samus.";

echo str_replace("love","<3",$string);
?>


Should change "I love Samus" to "I <3 Samus".

This post has been edited by Samus: 26 December 2011 - 09:01 PM

0

#6 User is online   rallport 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 3,818
  • Joined: 03-January 10
  • Reputation: 266
  • Gender:Male
  • Location:England, UK
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 27 December 2011 - 08:46 PM

View PostStripes-_-B3llatr1x, on 26 December 2011 - 02:17 AM, said:

Personal Reasons. So Can You Help? Or Is That All You're Going To Do? I Know This Can Be Done In PHP Too, Which Is What I'm Going For...


Really rude. I definately won't be replying.

Do people actually expect to get help by being like this? :/
0

#7 User is online   rallport 

  • Web Guru
  • PipPipPipPipPip
  • Group: Members
  • Posts: 3,818
  • Joined: 03-January 10
  • Reputation: 266
  • Gender:Male
  • Location:England, UK
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 27 December 2011 - 08:47 PM

View PostSamus, on 26 December 2011 - 09:00 PM, said:

That sounds abit rude..

Anyway, you could use the PHP function str_replace().

Something like..

<?php
$string = "I love Samus.";

echo str_replace("love","<3",$string);
?>


Should change "I love Samus" to "I <3 Samus".


Would become very messy, tedious and hard to maintain whn you're making lots of replacements, like the OP :(
0

#8 User is offline   web-itec 

  • Expert
  • PipPipPipPip
  • Group: Members
  • Posts: 533
  • Joined: 23-March 11
  • Reputation: 53
  • Gender:Male
  • Location:United Kingdom
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 27 December 2011 - 11:45 PM

as rallport said the code posted will get messy eventually, you will want atleast an array of inputs and their replacements and prob put through a for loop or function to do each one, could do thousands of replacements in 5lines of coding
0

#9 User is offline   Stripes-_-B3llatr1x 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 20
  • Joined: 28-July 11
  • Reputation: 0

Posted 29 December 2011 - 06:37 PM

My Intent Wasn't To Be Rude. I See How That Could Be Offensive, Though... Sorry For The Miscomunication. :)
And I'm Trying The Line Of Code Now... I'll Update With Results. Thanks Samus.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users