mike1313
-
Posts
116 -
Joined
-
Last visited
Posts posted by mike1313
-
-
$xy9 returns a number if that number is a certain number I need it to filter out the beginning of a string.
I tried using strlen instead of $xy9=100
I just need it to search for a number if its that number remove it from the string. or if strlen=2, 3, 4 I need to remove the 2nd, 3rd, 4th, characters of the string.
say strlen=2 I want substr to remove the 2 characters, 3, 4 and so on.
-
This is jumbled but this is the code.
if($xy9 > "0" && $xy9 < "10") { $do_pm3 = substr("$do_pm2", 1); } elseif($xy9 > "10" && $xy9 < "100") { $do_pm3 = substr($do_pm2, 0, 2); } elseif($xy9 > "100" && $xy9 < "1000") { $do_pm3 = substr("$do_pm2", 0, 3); } elseif($xy9 > "1000" && $xy9 < "10000") { $do_pm3 = substr("$do_pm2", 0, 4); }
The only string returning anything is the first.
-
Well say in a form, they input "123456 How are you?"
using substr how would I get rid of just 1 2 3 4 at each step?
I guess what I'm saying is it possible with an unknown str length?
-
I've read the documentation on php.net, but still dont full understand.
$string = '123456';
$return = substr("$string", 1);
echo "$return";
I know that $return will echo 23456.
But How can I for instance, using substr be able to echo 345, 456, 56?
Please any help is appreciated. Thanks.
-
I have a chat room. I need help with this.
$do_pm = preg_replace("|/pm *|", "", $decode);
I'm replacing what's after /pm.
Say /pm 45
is there anyway I can find out whats entered after 45? preferrrably by using preg_replace? or some other method.
Any help is appreciated.
-
What if I want to select the 2nd word than everything 3rd word and on?
-
using <input type-text name=somevar>
Alright say they type /word Hello Guy
I just need something where it can select "Hello"
and
"Guy"
into 2 seperate strings. So I can run 2 different queries.
-
bump
-
That would work but I need to find out what they are typing in the same input box though.
-
With an form input box I need to check to see if the user typed after something say they typed "hello Bob Franklin" I need it to select Bob and Franklin in 2 seperate forms, how can I do this?
-
I've written a ranking system, it finds the user in the db sorts their sort highest to lowest then displays it on the page as such.
1. John 3400 points
2. Sue 2600 points
3. Joe 1200 points
How could I make it so for 1 is says 1st instead of 1 all the way to lets say 1000 or unlimited? 2nd 3rd 4th etc.
-
I've written a simple chatroom for my website. But I want to know how I can make it so if the user types a certain command, that a certain table in the MySql DB can be updated and it doesnt display anything on the page. For example if they wanted to change the color of their font in the chat, they would type /hexcode #FFFFFF
and it would find them in the db and under the field chatfont it would change it to #FFFFFF, I know everything about updating the DB and so forth all I need is what I should use for the line of code to check to see if they posted at least /hexcode and it gets rid of /hexcode and just updates the db with #FFFFFF all help is appreciated thanks.
I dont know if this is at all possible.
in PHP Coding Help
Posted
I have map for our users in our online MMORPG. We have a section, where you walk around starting at 0,0 thats x,y coords each time you click a direction it updates their coord in the db, but the way the x,y are displayed everytime they move, the number is always 1 behind is there anyway to display the output as a change everytime they click? so if they are at 1,1 they go north itll still display 1,1 until they click again I want them to be able to click once and itll show 1,2 is this at any way possible?