RE: [PHP] Converting a string

2006-03-17 Thread Jay Blanchard
[snip] Well, you didn't answer the second question, how would you do it? So far I see a pattern: "ignore the lowercase letters at the beginnig and add a space before an uppercase" (this won't apply to all field names, and I hope you're aware of that), so try something like $text = pr

Re: [PHP] Converting a string

2006-03-17 Thread Rafael
Well, you didn't answer the second question, how would you do it? So far I see a pattern: "ignore the lowercase letters at the beginnig and add a space before an uppercase" (this won't apply to all field names, and I hope you're aware of that), so try something like $text = preg_replace('/^

RE: [PHP] Converting a string

2006-03-17 Thread Jay Blanchard
[snip] You're best off using an array that matches human readable form to field name as someone else suggested earlier. Form names for basic fields like this should be standardized such that auto form fillers (aka Google toolbar) are able to work. They won't know that your field named "hm

Re: [PHP] Converting a string

2006-03-17 Thread Myk OLeary
You're best off using an array that matches human readable form to field name as someone else suggested earlier. Form names for basic fields like this should be standardized such that auto form fillers (aka Google toolbar) are able to work. They won't know that your field named "hmnrdble_

RE: [PHP] Converting a string

2006-03-17 Thread Jay Blanchard
[snip] Then you should change the name of the field. Seriously, what do you expect the script to do, exactly? and once you know the answer, what would you do to achieve that? Put that (emphasis to the second question) in words and someone might be able to help you. [/snip] I expect th

Re: [PHP] Converting a string

2006-03-17 Thread Rafael
Jay Blanchard wrote: [snip] If you have similar element names in $_POST, comething like: $human_friendly = array("psFirstName" => "First Name"); foreach ($_POST as $ key => value) { echo "Cannot leave {$human_friendly[$key]} blank"; } [/snip] But I don't want to create another array, and sho

RE: [PHP] Converting a string

2006-03-17 Thread Shaunak Kashyap
y the sender by reply e-mail and destroy all copies of this transmission. > -Original Message- > From: Shaunak Kashyap [mailto:[EMAIL PROTECTED] > Sent: Friday, March 17, 2006 10:49 AM > To: Jay Blanchard; Dave Goodchild > Cc: php-general@lists.php.net > Subject: RE: [PHP] C

RE: [PHP] Converting a string

2006-03-17 Thread Shaunak Kashyap
AM > To: Dave Goodchild > Cc: php-general@lists.php.net > Subject: RE: [PHP] Converting a string > > [snip] > > If you have similar element names in $_POST, comething like: > > $human_friendly = array("psFirstName" => "First Name"); > > fo

RE: [PHP] Converting a string

2006-03-17 Thread Jay Blanchard
[snip] If you have similar element names in $_POST, comething like: $human_friendly = array("psFirstName" => "First Name"); foreach ($_POST as $ key => value) { echo "Cannot leave {$human_friendly[$key]} blank"; } [/snip] But I don't want to create another array, and should'nt have to

[PHP] Converting a string

2006-03-17 Thread Jay Blanchard
I think that we did this before, but I cannot find my notes or in the archive because I am not sure what we called it. Let us say that that I have a form item (I'll leave out clutter); It arrives in processing as $_POST['psFirstName'] Now, I have one of these for each form item, each with a di

[PHP] Recall: [PHP] Converting a string into ASCII and a bit more - newbie

2004-11-15 Thread Alp Bekisoglu
The sender would like to recall the message, "[PHP] Converting a string into ASCII and a bit more - newbie". -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Converting a string into ASCII and a bit more - newbie

2004-11-15 Thread Alp
Thanks Matthew, Got it going finally. Would you be able to help in my further question? Alp "Matthew Fonda" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > This ought to work: > $string = 'ABCDEFGHIJ'; > $chars = preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY); > for ($i = 0;

Re: [PHP] Converting a string into ASCII and a bit more - newbie

2004-11-15 Thread Matthew Fonda
This ought to work: On Sun, 2004-11-14 at 22:32, Alp wrote: > Hi, > > My question could have quite stright forward answer or the question itself > might be silly but being a newbie, I'll ask it anyway. > First I am trying to convert each character in a string into their > respective ASCII code

RE: [PHP] Converting a string into ASCII and a bit more - newbie

2004-11-15 Thread Alp Bekisoglu
Hi Klaus, Thanks you very much both for your quick reply and guidance. Yes, it now works as it should. I have a few further questions all related to the subject if you wouldn't mind. One is: how can I do the following (sort of maths) with a secondary string of ascii values i.e. 25203030 with thi

Re: [PHP] Converting a string into ASCII and a bit more - newbie

2004-11-14 Thread Klaus Reimer
Alp wrote: $x=1 while ($x<=strlen($string)) { $holder = ord(substr($string, $x, 1)); $result = $result . $holder; } and failed since it takes ages to process and does not really return a proper value/result but repetitive number such as 1.. I think you forgot to increment $x

[PHP] Converting a string into ASCII and a bit more - newbie

2004-11-14 Thread Alp
Hi, My question could have quite stright forward answer or the question itself might be silly but being a newbie, I'll ask it anyway. First I am trying to convert each character in a string into their respective ASCII codes and then keep these again in a string. Such as: string : ABCDEFGHIJ, expe

Re: [PHP] Converting a string to formatted html

2003-10-27 Thread Justin French
Ian, PLEASE search the archives before asking the list -- this question is asked every couple of days, which is quite frustrating. See http://au.php,net/nl2br Justin French On Monday, October 27, 2003, at 09:15 PM, Ian Gray wrote: Hi all, I know this can be done somehow but I am not sure.

[PHP] Converting a string to formatted html

2003-10-27 Thread Ian Gray
(I'm re-submitting this 'cos I sent it in html- woops!) Hi all, I know this can be done somehow but I am not sure. I have a form being submitted to a php file and I wanted a textfield to be converted to formatted html. At the moment none of the line breaks are being submitted and inverted co

[PHP] Converting a string to formatted html

2003-10-27 Thread Ian Gray
Hi all, I know this can be done somehow but I am not sure. I have a form being submitted to a php file and I wanted a textfield to be converted to formatted html. At the moment none of the line breaks are being submitted and inverted commas have slashes. I know the slashes can be removed us