What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » PHP help

PHP help
Author: Message:
spokes
Full Member
***

Avatar
I <3 Rollerblading

Posts: 423
Reputation: 10
34 / Male / Flag
Joined: May 2004
O.P. PHP help
Can anybody help me?

Im making an msn nickname thing in php, and i need it to go through each letter the user types

and for example put a < in front of that letter and > at the end

say i type
Spokes

i need it so it says

<S><p><o><k><e><s>

[Image: sig15ws.png]
08-31-2005 03:18 PM
Profile E-Mail PM Web Find Quote Report
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: PHP help
Something like this?

code:
<?php

$input = 'Spokes';

$output = '';
for($i = 0; $i < strlen($input); $i++) {
    $output .= '<'.substr($input, $i, 1).'>';
}

echo $output;

?>
08-31-2005 03:30 PM
Profile PM Web Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: PHP help
Why you asked for help for something so simple, I don't know.

Note: be careful about where you use the resulting text. You may need to convert the '<' and '>' to '&lt;' and '&gt;' (there's a function that does that in PHP btw).
[Image: spartaafk.png]
08-31-2005 03:43 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On