Re: [PHP] Strings
I noticed that too :) -- itoctopus - http://www.itoctopus.com "Robert Cummings" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tue, 2007-06-05 at 19:57 +0200, Jochem Maas wrote: >> do you notice the totally weird string delimiters in your original post? >> using either single quotes or double quotes (if you want variables named >> inside >> the string to be interpolated). read up on php strings here: >> >> http://php.net/string > > He's probably using MS-Word to write code... those look very similar to > dumb-quotes. Have you notice they open with a superscript 3 and close > with a superscript 2? > > Cheers, > Rob. > -- > .. > | InterJinn Application Framework - http://www.interjinn.com | > :: > | An application and templating framework for PHP. Boasting | > | a powerful, scalable system for accessing system services | > | such as forms, properties, sessions, and caches. InterJinn | > | also provides an extremely flexible architecture for | > | creating re-usable components quickly and easily. | > `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings
It would really help if you didn't use funky characters for quote that aren't quote in your email. It would help even more if you copy/paste your actual script. On Tue, June 5, 2007 12:50 pm, Steve Marquez wrote: > The following code works: > > > $image = ³²; > > if ($image == NULL) { > print ³False!²; > }else{ > print ³$var²; > } > > ?> > > However, this does not: > > > $image = ³²; > > if ($image == NULL) { > print ³False!²; > }else{ > print ³²; > } > > ?> > > It seems that if I add a string, rather than just the variable, then > does > not work. I am getting an unexpected T_IS_EQUAL error. > > -- > Thanks, > Steve Marquez > -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings
Pastor Steve wrote: > Thank you. > > I tried what you suggested below and it gave me an unexpected > T_CONSTANT_ESCAPED_STRING error. > > Would this be valid: (I am typing in my Entourage, but I am writing the code > in Dreamweaver. You are probably seeing the quotes that Entourage (my email > application) is giving you.) > > > $image = ""; >> if ($image == NULL) { >> print "False"; >> } else { >> >> ?> >> >> > >> } >> > ?> > > It works if $image is not NULL. However, if it is empty, then it gives me an $image is never NULL in your example - empty is not exactly the same as NULL, although NULL is considered empty. anyway, just for fun chew on this and see if something sticks: '; } ?> > error. I am very much so a novice and appreciate your patience. okay novice - post the error - even gurus (thats not me) can't mind read. :- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings
I got it to work! I just had to place the HTML elements outside of the PHP code. Thanks for your help. -- Steve Marquez on 6/5/07 2:02 PM Jochem Maas ([EMAIL PROTECTED]) wrote: > Robert Cummings wrote: >> > On Tue, 2007-06-05 at 19:57 +0200, Jochem Maas wrote: >>> >> do you notice the totally weird string delimiters in your original post? >>> >> using either single quotes or double quotes (if you want variables named >>> inside >>> >> the string to be interpolated). read up on php strings here: >>> >> >>> >> http://php.net/string >> > >> > He's probably using MS-Word to write code... those look very similar to >> > dumb-quotes. Have you notice they open with a superscript 3 and close >> > with a superscript 2? > > I did notice what chars they were, but couldn't be sure how/why they were > there. > I was hoping 'weird' was a close enough approximation :-P > >> > >> > Cheers, >> > Rob. >
Re: [PHP] Strings
Pastor Steve wrote: > Thank you. > > I tried what you suggested below and it gave me an unexpected > T_CONSTANT_ESCAPED_STRING error. > > Would this be valid: (I am typing in my Entourage, but I am writing the code > in Dreamweaver. get a real text editor before you go mad. textpad or ultraedit or something like that - check the list archives, there are plenty of threads related to 'whats the best editor' > You are probably seeing the quotes that Entourage (my email > application) is giving you.) setup your email client to use plaintext or get another one. it will save lots of headache if you intend to make use of mailinglists like this one. > > > $image = ""; >> if ($image == NULL) { >> print "False"; >> } else { >> >> ?> >> >> > >> } >> > ?> > > It works if $image is not NULL. However, if it is empty, then it gives me an > error. I am very much so a novice and appreciate your patience. > > Thanks, > > Steve Marquez > > on 6/5/07 1:04 PM Richard S. Crawford ([EMAIL PROTECTED]) wrote: > >> On Tuesday 05 June 2007 10:50:15 Steve Marquez wrote: It seems that if I add a string, rather than just the variable, then does not work. I am getting an unexpected T_IS_EQUAL error. >> Your string delimiters are very strange; I'm not sure if your code has those >> in it or not, so I can't really diagnose your problem. >> >> At any rate, make sure your code looks like this: >> >> > >> $image = ""; >> if ($image == NULL) { >> print "False"; >> } else { >> print ""; >> } >> >> ?> >> >> If that still gives you problems, you could try replacing the second print >> statement with this: >> >> print ""; >> >> just to see if the problem is with the string or is some strange >> interpolation >> issue. > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings
Robert Cummings wrote: > On Tue, 2007-06-05 at 19:57 +0200, Jochem Maas wrote: >> do you notice the totally weird string delimiters in your original post? >> using either single quotes or double quotes (if you want variables named >> inside >> the string to be interpolated). read up on php strings here: >> >> http://php.net/string > > He's probably using MS-Word to write code... those look very similar to > dumb-quotes. Have you notice they open with a superscript 3 and close > with a superscript 2? I did notice what chars they were, but couldn't be sure how/why they were there. I was hoping 'weird' was a close enough approximation :-P > > Cheers, > Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings
Thank you. I tried what you suggested below and it gave me an unexpected T_CONSTANT_ESCAPED_STRING error. Would this be valid: (I am typing in my Entourage, but I am writing the code in Dreamweaver. You are probably seeing the quotes that Entourage (my email application) is giving you.) > $image = ""; > if ($image == NULL) { > print "False"; > } else { > > ?> > > > } > ?> It works if $image is not NULL. However, if it is empty, then it gives me an error. I am very much so a novice and appreciate your patience. Thanks, Steve Marquez on 6/5/07 1:04 PM Richard S. Crawford ([EMAIL PROTECTED]) wrote: > On Tuesday 05 June 2007 10:50:15 Steve Marquez wrote: >> > It seems that if I add a string, rather than just the variable, then does >> > not work. I am getting an unexpected T_IS_EQUAL error. > > Your string delimiters are very strange; I'm not sure if your code has those > in it or not, so I can't really diagnose your problem. > > At any rate, make sure your code looks like this: > > > $image = ""; > if ($image == NULL) { > print "False"; > } else { > print ""; > } > > ?> > > If that still gives you problems, you could try replacing the second print > statement with this: > > print ""; > > just to see if the problem is with the string or is some strange interpolation > issue.
Re: [PHP] Strings
On Tue, 2007-06-05 at 11:04 -0700, Richard S. Crawford wrote: > On Tuesday 05 June 2007 10:50:15 Steve Marquez wrote: > > It seems that if I add a string, rather than just the variable, then does > > not work. I am getting an unexpected T_IS_EQUAL error. > > Your string delimiters are very strange; I'm not sure if your code has those > in it or not, so I can't really diagnose your problem. > > At any rate, make sure your code looks like this: > > > $image = ""; > if ($image == NULL) { > print "False"; > } else { > print ""; > } > > ?> Heheh, it probably already "looks" like that... just isn't actually that :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings
On Tuesday 05 June 2007 10:50:15 Steve Marquez wrote: > It seems that if I add a string, rather than just the variable, then does > not work. I am getting an unexpected T_IS_EQUAL error. Your string delimiters are very strange; I'm not sure if your code has those in it or not, so I can't really diagnose your problem. At any rate, make sure your code looks like this: "; } ?> If that still gives you problems, you could try replacing the second print statement with this: print ""; just to see if the problem is with the string or is some strange interpolation issue. -- Richard S. Crawford (http://www.mossroot.com) Editor In Chief, Daikaijuzine (http://www.daikaijuzine.com) AIM: Buffalo2K / GTalk: [EMAIL PROTECTED] "We are here to help each other get through this thing, whatever it is." (Kurt Vonnegut, 1922 - 2007) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings
On Tue, 2007-06-05 at 19:57 +0200, Jochem Maas wrote: > do you notice the totally weird string delimiters in your original post? > using either single quotes or double quotes (if you want variables named > inside > the string to be interpolated). read up on php strings here: > > http://php.net/string He's probably using MS-Word to write code... those look very similar to dumb-quotes. Have you notice they open with a superscript 3 and close with a superscript 2? Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Strings
> > your syntax is broken because of the weird quotes it seems. I agree. After replacing all the superscripted 2's and 3's with proper quotes, the examples both work as expected. JM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings
do you notice the totally weird string delimiters in your original post? using either single quotes or double quotes (if you want variables named inside the string to be interpolated). read up on php strings here: http://php.net/string Steve Marquez wrote: > The following code works: > > > $image = ³²; > > if ($image == NULL) { > print ³False!²; > }else{ > print ³$var²; > } > > ?> > > However, this does not: > > > $image = ³²; > > if ($image == NULL) { > print ³False!²; > }else{ > print ³²; > } > > ?> > > It seems that if I add a string, rather than just the variable, then does 'add a string' - huh? I don't understand what you mean, I'm (sure I'm) not the only one (to quote Lennon). > not work. I am getting an unexpected T_IS_EQUAL error. your syntax is broken because of the weird quotes it seems. > > -- > Thanks, > Steve Marquez > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strings
The following code works: However, this does not: ²; } ?> It seems that if I add a string, rather than just the variable, then does not work. I am getting an unexpected T_IS_EQUAL error. -- Thanks, Steve Marquez
Re: [PHP] strings
Curt Zirzow writes: > I did some testing you can see the code and results here: > http://zirzow.dyndns.org/html/php/tests/preg/parse_doc.php .. Thanks Curt. I checked it out and I still pick up the following lines which I was looking to delete on the pattern match. They are: . Expires:No;;725283 //line 1 AWUS41 KALY 012014 //line 2 RWSALB // line 3 . It could be that when the URL file is being opened and read that these characters are on _three_ different_ lines as opposed to one line/string and the match is not being met. I was looking to delete those lines and to start the match at REGIONAL. Best... TR -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strings
* Thus wrote Anthony Ritter ([EMAIL PROTECTED]): > Curt Zirzow wrote in message: > > > This exact thing was talked about earlier today, with the subject > > 'Using eregi_replace()'. > > > Right. > > However, I've tried using the following code in which the text from the URL > is printed out completely and then I change the variable from $contents to > $text and using the line with preg_replace(), it still outputs the complete > text without the pattern match. hm.. I sort of misunderstood, preg_replace isn't what you need. use preg_match instead. I did some testing you can see the code and results here: http://zirzow.dyndns.org/html/php/tests/preg/parse_doc.php > $newtext= preg_replace("!.*?(REGIONAL.*YORK).*!","$1",$text); btw, there these should be single quotes ~~^ ^ or "\$1" so php doesn't expand the variable (even though its an illagal php var name.) HTH, Curt -- "I used to think I was indecisive, but now I'm not so sure." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strings
Curt Zirzow wrote in message: > This exact thing was talked about earlier today, with the subject > 'Using eregi_replace()'. Right. However, I've tried using the following code in which the text from the URL is printed out completely and then I change the variable from $contents to $text and using the line with preg_replace(), it still outputs the complete text without the pattern match. Any advice will be helpful. Thank you. TR http://weather.noaa.gov/pub/data/summaries/regional/ny/albany.txt";; if (!($fp=fopen($theurl, "r"))) { echo "Could not open the URL."; exit; } $contents=fread($fp, 100); fclose($fp); echo $contents; echo ""; $text=$contents; $newtext= preg_replace("!.*?(REGIONAL.*YORK).*!","$1",$text); echo $newtext; // outputs the same text as above ?> .. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strings
* Thus wrote Anthony Ritter ([EMAIL PROTECTED]): > In the following snippet, I'm trying to open and read a URL into the > variable $contents. > I'd like to use preg_replace() to return only part of that string beginning > with say - regional and ending with new - but I get the complete URL string > returned. > > [...] > > $newtext= preg_replace("/.*?(regional.*new).*/","1",$contents); This exact thing was talked about earlier today, with the subject 'Using eregi_replace()'. http://marc.theaimsgroup.com/?t=10597485126&r=1&w=2 HTH, Curt -- "I used to think I was indecisive, but now I'm not so sure." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strings
In the following snippet, I'm trying to open and read a URL into the variable $contents. I'd like to use preg_replace() to return only part of that string beginning with say - regional and ending with new - but I get the complete URL string returned. Thank you for any assistance. Tony Ritter ... http://weather.noaa.gov/pub/data/summaries/regional/ny/albany.txt";; if (!($fp=fopen($theurl, "r"))) { echo "Could not open the URL."; exit; } $contents=fread($fp, 100); $newtext= preg_replace("/.*?(regional.*new).*/","1",$contents); fclose($fp); echo $newtext; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Strings and regular expression?
> > Very true, I agree. For your solution, though, wouldn't it correctly > match a > > string such as '2,3,11,12' even though there is no entry that's just > one? > > Ok, why not something like this.. > There is almost always a better solution than regex > > > $string = '98,244,9,243,2,6,36,3,111,'; > > if(catchOne($string) == 'TRUE'){ > echo 'Found a One'; > }else{ > echo 'No match found'; > } > > function catchOne($string){ > > $arr = explode(',', $string); > > // check if the 1 is in the array > if(in_array('1', $arr)){ > return TRUE; > }else{ > return FALSE; > } > } I love it when questions like this come up. Honestly, you can use any solution you want and it's not going to make that much of a difference. But... it's always fun to benchmark them all and see which one wins. Here's the code I tried (which uses PEAR Benchmark) $str = '1,2,3,4,5,6,7,8,9,0'; $timer->start(); if(preg_match('/(^|,)1(,|$)/',$str)) {} $timer->setMarker('Preg'); if(in_array('1',explode(',',$str))) {} $timer->setMarker('Explode'); if(strstr($str,',1,') || substr($str,0,2)=='1,' || substr($str,-2)==',1') {} $timer->setMarker('Strstr'); $timer->stop(); $timer->display(); and, the results... Method Elapsed Time Preg0.80 Explode 0.65 Strstr 0.65 Make your own conclusions... Since the last solution actually uses three tests, it is even faster overall when the first condition comes out true and then gets slower if it has to check the second and then third condition. So, putting whatever condition is true the majority of the time will make that solution more efficient. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings and regular expression?
This one time, at band camp, "1LT John W. Holmes" <[EMAIL PROTECTED]> wrote: > > Very true, I agree. For your solution, though, wouldn't it correctly match a > string such as '2,3,11,12' even though there is no entry that's just one? Ok, why not something like this.. There is almost always a better solution than regex Kevin -- __ (_ \ _) ) | / / _ ) / _ | / ___) / _ ) | | ( (/ / ( ( | |( (___ ( (/ / |_| \) \_||_| \) \) Kevin Waterson Port Macquarie, Australia -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings and regular expression?
> > > $a1="1,8,98,244,9,243,2,6,36,3,111,"; > > > > > > $a2="8,98,244,9,243,2,1,6,36,3,111,"; > > > > > > How can I exactly match "1," in both strings using one regular expression? > > > (first "1" is the first element and second time in a random position)? > > > > if(preg_match('/(^|,)1(,|$)/',$str)) > > { echo "one is found"; } > > if(strstr($string, '1,') == 'FALSE){ > echo 'No match found'; > }else{ > echo 'Found a match'; > } > > No need for costly regex Very true, I agree. For your solution, though, wouldn't it correctly match a string such as '2,3,11,12' even though there is no entry that's just one? I assumed that one could be the last value in the string also, though, and hence the regular expression. If the 1 can be the last number in the string, then you could also use something like your solution (looking for ',1,') and include an OR that checks for the last two characters being ',1' OR the first two characters being '1,' Check if that or the regex is faster. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings and regular expression?
This one time, at band camp, "1LT John W. Holmes" <[EMAIL PROTECTED]> wrote: > > $a1="1,8,98,244,9,243,2,6,36,3,111,"; > > > > $a2="8,98,244,9,243,2,1,6,36,3,111,"; > > > > How can I exactly match "1," in both strings using one regular expression? > > (first "1" is the first element and second time in a random position)? > > if(preg_match('/(^|,)1(,|$)/',$str)) > { echo "one is found"; } if(strstr($string, '1,') == 'FALSE){ echo 'No match found'; }else{ echo 'Found a match'; } No need for costly regex Kevin -- __ (_ \ _) ) | / / _ ) / _ | / ___) / _ ) | | ( (/ / ( ( | |( (___ ( (/ / |_| \) \_||_| \) \) Kevin Waterson Port Macquarie, Australia -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings and regular expression?
> $a1="1,8,98,244,9,243,2,6,36,3,111,"; > > $a2="8,98,244,9,243,2,1,6,36,3,111,"; > > How can I exactly match "1," in both strings using one regular expression? > (first "1" is the first element and second time in a random position)? if(preg_match('/(^|,)1(,|$)/',$str)) { echo "one is found"; } ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strings and regular expression?
Hi guys, I have 2 strings $a1="1,8,98,244,9,243,2,6,36,3,111,"; $a2="8,98,244,9,243,2,1,6,36,3,111,"; How can I exactly match "1," in both strings using one regular expression? (first "1" is the first element and second time in a random position)? Thanks, Radu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings and default values...
1) You most likely have magic_quotes_gpc set to on. Either set it to off or stripslashes() the input. 2) No, it won't print. Think of a heredoc as a quotes string without the quotes. You can, however, do something like: $variable = <<< WHATEVER whatever text goes here WHATEVER; $variable.= executesomephp(); $variable = <<< WHATEVER whatever other text goes here WHATEVER; Steven Kallstrom wrote: Dear List, This is a simple problem, but I can't really find a good solution. and I have a general question also. 1) I have a webform that is save to a variable $html using heredoc. $html = <<< WEBFORM . . the problem is that when you enter an apostrophe, and then repost the page with the stored values, the apostrophe appears escaped in the edit form. how can I solve this? 2) is it possible to put additional ('nested') php inside a heredoc, or will that text simply print out? Thank you, Steven Kallstrom -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strings and default values...
Dear List, This is a simple problem, but I can't really find a good solution. and I have a general question also. 1) I have a webform that is save to a variable $html using heredoc. $html = <<< WEBFORM . . the problem is that when you enter an apostrophe, and then repost the page with the stored values, the apostrophe appears escaped in the edit form. how can I solve this? 2) is it possible to put additional ('nested') php inside a heredoc, or will that text simply print out? Thank you, Steven Kallstrom
Re[2]: [PHP] strings and vars
yiihhuuuvvv it works; I heard it, i remember variable variables I guess Thanks all EEV> $var = 'string'; EEV> $$var will resolve as $string -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strings and vars
At 02:05 24.11.2002, empty said: [snip] >i have string like: "string"; > >how can i get variable $string; [snip] $var = 'string'; $$var will resolve as $string -- >O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strings and vars
Hi; i have a string and I want to set it as a variable name. like tahat i have string like: "string"; how can i get variable $string; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings and php.ini
On Sunday 17 November 2002 06:27, Khalid El-Kary wrote: > hi, > i was asking if there should be difference in functionality of PH string > functions (not mb_) between the two following configurations: > > the company: PHP 4.2.1, Apache 1.3.20, linux > me: PHP 4.2.3, Apache 1.3.24, windows > magic_qoutes_gpc off on This setting can potentially make a difference. BTW, where possible, please use copy and paste. "magic_qoutes_gpc" should be "magic_quotes_gpc". Introducing spurious typos into does not help in diagnosing anybody's problems. Why don't you say exactly _what_ problems you're having? -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Modern man is the missing link between apes and human beings. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings and php.ini
Hello, (B (B"Khalid El-Kary" <[EMAIL PROTECTED]> wrote: (B> hi, (B> i was asking if there should be difference in functionality of PH string (B> functions (not mb_) between the two following configurations: (B> (B> the company: PHP 4.2.1, Apache 1.3.20, linux (B> me: PHP 4.2.3, Apache 1.3.24, windows (B> (B> my confthe company's conf (B> thread safety Enabled Disabled (B> allow_call_time_pass_reference off On (B> implicit_flush on off (B> log_errors off on (B> magic_qoutes_gpc off on (B> register_globals off on (B (BSince I haven't seen any of your code, all I can do is guess. (B (BSo, I think it would be better if you just (B(1) Edit your php.ini. Make the setting the same as the company's. (Later, (Byou might want to look at the way they compiled their php as well.) (B(2) After you finish editing, restart your web server. Then, (B(3) Try running your php scripts again. (B (BIF you are able to run the scripts without any problem THEN the problem lies (Bsomewhere else... (B (B- E (B (B-- (BPHP General Mailing List (http://www.php.net/) (BTo unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings and php.ini
hi, i was asking if there should be difference in functionality of PH string functions (not mb_) between the two following configurations: the company: PHP 4.2.1, Apache 1.3.20, linux me: PHP 4.2.3, Apache 1.3.24, windows my confthe company's conf thread safety Enabled Disabled allow_call_time_pass_reference off On implicit_flush on off log_errors off on magic_qoutes_gpc off on register_globals off on thanx khalid _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings and php.ini
Hello, (B (B"Khalid El-Kary" <[EMAIL PROTECTED]> wrote: (B (B> hi, (B> the script infact never used register_globals because it's a (B> class that has nothing to do with the direct script input, but (B> there's an idea that came to my mind, maybe the company (B> compiled its own PHP? may this change anything? (B (BIt's not impossible but I don't think they would really do that. Maybe you (Bshould ask them. Or, run phpinfo() and check. Did you check? What did you (Bfind out? (B (B> generally is Linux different from windows in String functions? (B (BGenerally no, I don't think so. (B (B> encoding for example? (B (BIt's possible that they are different but you can check phpinfo(). (B (BAlso, if you're using multi-byte functions there's a possibility that your (Bthe company you're using did not compile php with this feature enabled. (B (B> thanx edwin, and sorry for writing so unpercise questions (B (BWell, later when you are ready to ask precise or specific questions, I'm (Bsure a lot more people will help you :-) (B (BAnyway, as I have mentioned earlier, run phpinfo() in Windows and in Linux (Bthen compare them. THEN, you might just find out what's causing the (Bproblem... (B (B- E (B (B-- (BPHP General Mailing List (http://www.php.net/) (BTo unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings and php.ini
hi, the script infact never used register_globals because it's a class that has nothing to do with the direct script input, but there's an idea that came to my mind, maybe the company compiled its own PHP? may this change anything? generally is Linux different from windows in String functions? encoding for example? thanx edwin, and sorry for writing so unpercise questions khalid _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings and php.ini
(B"Khalid El-Kary" <[EMAIL PROTECTED]> wrote: (B> hi, (B> infact i'm un (B> able to obtain a copy of my hosting company's php.ini (B (BThen, perhaps, try running phpinfo() and compare. (B (BI think it might even have something to do with "register_globals". (B (B- E (B (B (B-- (BPHP General Mailing List (http://www.php.net/) (BTo unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings and php.ini
hi, infact i'm un able to obtain a copy of my hosting company's php.ini thanx _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings and php.ini
Hello, (B (B"Khalid El-Kary" <[EMAIL PROTECTED]>wrote: (B> hi, (B> (B> are there any php.ini directives that control the PHP string functions? (B (BYou mean something like this? (Under "; Safe Mode") (B (B-> (B; This directive allows you to disable certain functions for security (Breasons. (B; It receives a comma-deliminated list of function names. This directive is (B; *NOT* affected by whether Safe Mode is turned On or Off. (Bdisable_functions = (B<- (B (B> sorry i'm not percise but infact i have a 1200 lines script that acts well (B> on a windows machine with PHP 4.2.3 Apache 1.3.24, but on a linux machine (B> with PHP 4.2.1 (keep it secret :)) and Apache 1.3.20 it acts bad (B> but the script wholly depends on string functions nothing more! (B> (B (BWhy don't you just compare you php.ini files? (B (B- E (B (B-- (BPHP General Mailing List (http://www.php.net/) (BTo unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strings and php.ini
hi, are there any php.ini directives that control the PHP string functions? sorry i'm not percise but infact i have a 1200 lines script that acts well on a windows machine with PHP 4.2.3 Apache 1.3.24, but on a linux machine with PHP 4.2.1 (keep it secret :)) and Apache 1.3.20 it acts bad but the script wholly depends on string functions nothing more! thanx in advance khalid _ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strings with embedded quotes and double quotes
On Wednesday 03 July 2002 09:54, C. Cormier - Ormetal Inc. wrote: > I need to echo a string that contains both quotes and double > quotes. > > I remember doing this once using a special construct where the > string started on a new line with a triple slash if I remember well. Or > it was a triple something... > > I can't find the topic in the online PHP doc... > > Anybody remember this construct? echo "'\""; # displays '" echo '\'"'; # displays '" -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Unix soit qui mal y pense [Unix to him who evil thinks?] */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strings with embedded quotes and double quotes
I need to echo a string that contains both quotes and double quotes. I remember doing this once using a special construct where the string started on a new line with a triple slash if I remember well. Or it was a triple something... I can't find the topic in the online PHP doc... Anybody remember this construct? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strings and \n
On Saturday 26 January 2002 04:48, Greg Sidelinger wrote: > Ok I'm having a problem with the new line char \n in strings. I'm > trying to contrast an email that gets sent with the mail() function. > Here is what I'm doing. > > $message = "line1\n"; > $message .= "line2\n\n"; > $message .= "line3\n"; > ... > $message = "lne99"; Is this a typo in your message or in your code? Shouldn't it be: $message .= "lne99"; > > mail ("email", "subject", $message); > > > but when the email is received not all the new lines r taken. Can anyone > help me. Also where can I get a list of all the special chars like \n > and what they meain. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* Biggest security gap -- an open mouth. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] strings and \n
\r\n or \n\r is not helping. The thing that confuses me is that some of the \n lines work just fine while others do not. So if anyone give give me a hint y it is not working all the time please send me email. Greg -Original Message- From: Nick Wilson [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 3:56 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] strings and \n -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Greg Sidelinger blurted > Ok I'm having a problem with the new line char \n in strings. I'm > trying to contrast an email that gets sent with the mail() function. > Here is what I'm doing. > > $message = "line1\n"; > $message .= "line2\n\n"; > $message .= "line3\n"; > > but when the email is received not all the new lines r taken. Can anyone > help me. Also where can I get a list of all the special chars like \n > and what they meain. I think you need to try \r\n (poss. other way round) That should do it. - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8UcZYHpvrrTa6L5oRAuliAJ4vouXleTkRY6IvSva2xS6BBnJHMgCeKHJW n3BzuUtk5LYJ3gra3SqxnXs= =fgqQ -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strings and \n
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Greg Sidelinger blurted > Ok I'm having a problem with the new line char \n in strings. I'm > trying to contrast an email that gets sent with the mail() function. > Here is what I'm doing. > > $message = "line1\n"; > $message .= "line2\n\n"; > $message .= "line3\n"; > > but when the email is received not all the new lines r taken. Can anyone > help me. Also where can I get a list of all the special chars like \n > and what they meain. I think you need to try \r\n (poss. other way round) That should do it. - -- Nick Wilson Tel:+45 3325 0688 Fax:+45 3325 0677 Web:www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) iD8DBQE8UcZYHpvrrTa6L5oRAuliAJ4vouXleTkRY6IvSva2xS6BBnJHMgCeKHJW n3BzuUtk5LYJ3gra3SqxnXs= =fgqQ -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] strings and \n
Ok I'm having a problem with the new line char \n in strings. I'm trying to contrast an email that gets sent with the mail() function. Here is what I'm doing. $message = "line1\n"; $message .= "line2\n\n"; $message .= "line3\n"; ... $message = "lne99"; mail ("email", "subject", $message); but when the email is received not all the new lines r taken. Can anyone help me. Also where can I get a list of all the special chars like \n and what they meain. Greg
Re: [PHP] Strings Question
On Mon, Dec 24, 2001 at 01:48:38PM -0800, Phillip B. Bruce wrote: > I want to take something like the following: > > $row = 1; > $ column = 1; > > if ( $pages = "r$row$column") > >What I want to see is r1c1 as a string so I'm actually > concatenating the strings together. if ($pages == "r$row" . "c$column") -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Strings Question
Hi, I want to take something like the following: $row = 1; $ column = 1; if ( $pages = "r$row$column") What I want to see is r1c1 as a string so I'm actually concatenating the strings together. Any ideas? -- *** Phillip B. Bruce *** *** http://pbbruce.home.mindspring.com *** *** [EMAIL PROTECTED] *** *** *** *** "Have you ever noticed? Anybody going slower than*** *** you is an idiot, and anyone going faster than you*** *** is a maniac." - George Carlin*** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strings in a function return
From: Gerard Samuel <[EMAIL PROTECTED]> Date: Wed, Aug 29, 2001 at 09:58:12PM -0400 Message-ID: <[EMAIL PROTECTED]> Subject: Re: [PHP] strings in a function return > I found an error, but it didn't do me any good. > I tried this, any tips... > Thanks > > function assign() { > global $adminurl, $string; > top(); > if ($string) { > $data = explode ("|", $string); > foreach ($data as $foo) { > echo $foo[0]; } > } > > > $array = array("$new_cat","$assigned_to","$job","$assigned_by"); > $string = implode("|",$array); > return $string; > } > > The variables that form $array are from the form Why use array("$new_cat",...,"$assigned_by"); Loose the quotes: array ($new_cat,...,$assigned_by); You don't need to use implode(). Just return the array. In the calling function you can then get the results in two ways: $results = assign(); /* $results is an array */ or list ($new_cat,...,$assigned_by) = assign(); If you want a better answer on what is going wrong, you'll need to send some more code. Eg the code that you've now replaced by . It might just be that the error is in that part. -- * R&zE: -- -- Renze Munnik -- DataLink BV -- -- E: [EMAIL PROTECTED] -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- Netherlands -- -- http://www.datalink.nl -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strings in a function return
Im beginning to think that functions aren't all that cracked up to be. I may as well go back to my old "non function" way of coding. I was displaying the form in the function because the application Im using currently displays forms in functions. Ill try and see what I can do with this new found knowledge called 'functions'. David Robley wrote: > On Thu, 30 Aug 2001 11:38, Gerard Samuel wrote: > >>top(); is a function that displays a menu, that works. >> is where the form goes. >>In its current setup less the array/implode/explode/foreach loop >>I can get it to echo 'a' return that I specify. But its no good, when >>I have 7 seven fields in the form to process. >> >>David Robley wrote: >> >>>On Thu, 30 Aug 2001 10:45, Gerard Samuel wrote: >>> Mozilla sucks sometimes with email formatting. Correction==> Here is a snippet example. function assign() { global $adminurl, $string; top(); if ($string) { $data = explode ("|", $string); echo "$data[0]"; } $array = array("$new_cat,$assigned_to","$job","$assigned_by"); >>>$string = implode("|",$array); return $string; >>> >>> } The variables that form $array are from the form >>>Hrm - undefined function top() >>> >>>?? ?? >>> >>>But the rest of it returns what I would expect - a comma followed by >>>two >>> >>>| - given that I don't have the values referenced in the array. And >>>| you >>> >>>won't either, as they aren't global and aren't passed as parameters. >>> > > > Why are you putting the form inside the function? There surely must be a > better way to achieve what you want (which is not clear from the snippet). > . > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strings in a function return
On Thu, 30 Aug 2001 11:38, Gerard Samuel wrote: > top(); is a function that displays a menu, that works. > is where the form goes. > In its current setup less the array/implode/explode/foreach loop > I can get it to echo 'a' return that I specify. But its no good, when > I have 7 seven fields in the form to process. > > David Robley wrote: > > On Thu, 30 Aug 2001 10:45, Gerard Samuel wrote: > >>Mozilla sucks sometimes with email formatting. > >>Correction==> > >> > >>Here is a snippet example. > >> > >>function assign() { > >> global $adminurl, $string; > >> top(); > >> if ($string) { > >> $data = explode ("|", $string); > >> echo "$data[0]"; > >>} > >> > >> > >>$array = array("$new_cat,$assigned_to","$job","$assigned_by"); > > > > $string = implode("|",$array); return $string; > > > >>} > >> > >>The variables that form $array are from the form > > > > Hrm - undefined function top() > > > > ?? ?? > > > > But the rest of it returns what I would expect - a comma followed by > > two > > > > | - given that I don't have the values referenced in the array. And > > | you > > > > won't either, as they aren't global and aren't passed as parameters. Why are you putting the form inside the function? There surely must be a better way to achieve what you want (which is not clear from the snippet). . -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Oxymoron: Virtual Reality. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strings in a function return
top(); is a function that displays a menu, that works. is where the form goes. In its current setup less the array/implode/explode/foreach loop I can get it to echo 'a' return that I specify. But its no good, when I have 7 seven fields in the form to process. David Robley wrote: > On Thu, 30 Aug 2001 10:45, Gerard Samuel wrote: > >>Mozilla sucks sometimes with email formatting. >>Correction==> >> >>Here is a snippet example. >> >>function assign() { >> global $adminurl, $string; >> top(); >> if ($string) { >> $data = explode ("|", $string); >> echo "$data[0]"; >> } >> >> >> $array = array("$new_cat,$assigned_to","$job","$assigned_by"); >> > $string = implode("|",$array); return $string; > >>} >> >>The variables that form $array are from the form >> > > Hrm - undefined function top() > > ?? ?? > > But the rest of it returns what I would expect - a comma followed by two > | - given that I don't have the values referenced in the array. And you > won't either, as they aren't global and aren't passed as parameters. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strings in a function return
On Thu, 30 Aug 2001 10:45, Gerard Samuel wrote: > Mozilla sucks sometimes with email formatting. > Correction==> > > Here is a snippet example. > > function assign() { > global $adminurl, $string; > top(); > if ($string) { > $data = explode ("|", $string); > echo "$data[0]"; > } > > > $array = array("$new_cat,$assigned_to","$job","$assigned_by"); $string = implode("|",$array); return $string; > } > > The variables that form $array are from the form Hrm - undefined function top() ?? ?? But the rest of it returns what I would expect - a comma followed by two | - given that I don't have the values referenced in the array. And you won't either, as they aren't global and aren't passed as parameters. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Shift happpens. - Doppler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strings in a function return
I found an error, but it didn't do me any good. I tried this, any tips... Thanks function assign() { global $adminurl, $string; top(); if ($string) { $data = explode ("|", $string); foreach ($data as $foo) { echo $foo[0]; } } $array = array("$new_cat","$assigned_to","$job","$assigned_by"); $string = implode("|",$array); return $string; } The variables that form $array are from the form David Robley wrote: > On Thu, 30 Aug 2001 10:19, Gerard Samuel wrote: > >>I was doing it like so ==> >>$string = array(var1, var2...); >>return string; >> >>I also tried to implode the array into a string and return the result, >>but no go. >> >>David Robley wrote: >> >>>On Thu, 30 Aug 2001 09:35, Gerard Samuel wrote: >>> Hey all. I just started venturing into functions. I have a function that displays a form, but I have a problem with getting the multiple strings back after the submit. Im tryed a return statement at the bottom of the function, but it cannot take more than one string. I tried turning the array into a string and returning just the string made sure that the string name was in the global list, still no luck. Is it even possible to return mulitple values from a function?? Thanks >>>You can only return one variable from a function, but that variable >>>can be an array. >>> >>>This is probably obvious, but you are assigning the result of the >>>function to a variable? Eg >>> >>>$result = my_function($my_parameter, $my_parameter); >>> > > Perhaps if you could show some of the code? > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strings in a function return
Mozilla sucks sometimes with email formatting. Correction==> Here is a snippet example. function assign() { global $adminurl, $string; top(); if ($string) { $data = explode ("|", $string); echo "$data[0]"; } $array = array("$new_cat,$assigned_to","$job","$assigned_by"); $string = implode("|",$array); return $string; } The variables that form $array are from the form David Robley wrote: > On Thu, 30 Aug 2001 10:19, Gerard Samuel wrote: > >>I was doing it like so ==> >>$string = array(var1, var2...); >>return string; >> >>I also tried to implode the array into a string and return the result, >>but no go. >> >>David Robley wrote: >> >>>On Thu, 30 Aug 2001 09:35, Gerard Samuel wrote: >>> Hey all. I just started venturing into functions. I have a function that displays a form, but I have a problem with getting the multiple strings back after the submit. Im tryed a return statement at the bottom of the function, but it cannot take more than one string. I tried turning the array into a string and returning just the string made sure that the string name was in the global list, still no luck. Is it even possible to return mulitple values from a function?? Thanks >>>You can only return one variable from a function, but that variable >>>can be an array. >>> >>>This is probably obvious, but you are assigning the result of the >>>function to a variable? Eg >>> >>>$result = my_function($my_parameter, $my_parameter); >>> > > Perhaps if you could show some of the code? > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strings in a function return
Here is a snippet example. function assign() { global $adminurl, $string; top(); if ($string) { $data = explode ("|", $string); echo "$data[0]"; } $array = array("$new_cat,$assigned_to","$job","$assigned_by") $string = implode("|",$array); return $string; } The variables that form $array are from the form David Robley wrote: > On Thu, 30 Aug 2001 10:19, Gerard Samuel wrote: > >>I was doing it like so ==> >>$string = array(var1, var2...); >>return string; >> >>I also tried to implode the array into a string and return the result, >>but no go. >> >>David Robley wrote: >> >>>On Thu, 30 Aug 2001 09:35, Gerard Samuel wrote: >>> Hey all. I just started venturing into functions. I have a function that displays a form, but I have a problem with getting the multiple strings back after the submit. Im tryed a return statement at the bottom of the function, but it cannot take more than one string. I tried turning the array into a string and returning just the string made sure that the string name was in the global list, still no luck. Is it even possible to return mulitple values from a function?? Thanks >>>You can only return one variable from a function, but that variable >>>can be an array. >>> >>>This is probably obvious, but you are assigning the result of the >>>function to a variable? Eg >>> >>>$result = my_function($my_parameter, $my_parameter); >>> > > Perhaps if you could show some of the code? > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strings in a function return
On Thu, 30 Aug 2001 10:19, Gerard Samuel wrote: > I was doing it like so ==> > $string = array(var1, var2...); > return string; > > I also tried to implode the array into a string and return the result, > but no go. > > David Robley wrote: > > On Thu, 30 Aug 2001 09:35, Gerard Samuel wrote: > >>Hey all. I just started venturing into functions. I have a function > >>that displays a form, but I have a problem with getting the multiple > >>strings back after the submit. Im tryed a return statement at the > >>bottom of the function, but it cannot take more than one string. I > >>tried turning the array into a string and returning just the string > >>made sure that the string name was in the global list, still no luck. > >>Is it even possible to return mulitple values from a function?? > >> Thanks > > > > You can only return one variable from a function, but that variable > > can be an array. > > > > This is probably obvious, but you are assigning the result of the > > function to a variable? Eg > > > > $result = my_function($my_parameter, $my_parameter); Perhaps if you could show some of the code? -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Oxymoron: Random Order. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strings in a function return
I was doing it like so ==> $string = array(var1, var2...); return string; I also tried to implode the array into a string and return the result, but no go. David Robley wrote: > On Thu, 30 Aug 2001 09:35, Gerard Samuel wrote: > >>Hey all. I just started venturing into functions. I have a function >>that displays a form, but I have a problem with getting the multiple >>strings back after the submit. Im tryed a return statement at the >>bottom of the function, but it cannot take more than one string. I >>tried turning the array into a string and returning just the string >>made sure that the string name was in the global list, still no luck. >>Is it even possible to return mulitple values from a function?? Thanks >> > > You can only return one variable from a function, but that variable can > be an array. > > This is probably obvious, but you are assigning the result of the > function to a variable? Eg > > $result = my_function($my_parameter, $my_parameter); > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strings in a function return
On Thu, 30 Aug 2001 09:35, Gerard Samuel wrote: > Hey all. I just started venturing into functions. I have a function > that displays a form, but I have a problem with getting the multiple > strings back after the submit. Im tryed a return statement at the > bottom of the function, but it cannot take more than one string. I > tried turning the array into a string and returning just the string > made sure that the string name was in the global list, still no luck. > Is it even possible to return mulitple values from a function?? Thanks You can only return one variable from a function, but that variable can be an array. This is probably obvious, but you are assigning the result of the function to a variable? Eg $result = my_function($my_parameter, $my_parameter); -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA "I'm single," Tom said wanly. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] strings in a function return
Hey all. I just started venturing into functions. I have a function that displays a form, but I have a problem with getting the multiple strings back after the submit. Im tryed a return statement at the bottom of the function, but it cannot take more than one string. I tried turning the array into a string and returning just the string made sure that the string name was in the global list, still no luck. Is it even possible to return mulitple values from a function?? Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Strings with Spaces in URLS
On Wednesday 22 August 2001 03:05, Chris Aitken wrote: > I have come up with a bit of a problem > > I have a little funky search form on a page, and when I send the search > data on as a URL, anything with a space is screwed up example > > $search = "This is a test"; > echo "http://www.blah.com/foo.php?search=$search>"; > > and when the link is clicked (or even when the mouse is put over the > link), the URL in the browser is - > > http://www.blah.com/foo.php?search=This > > leaving out all words after the first space. http://php.net/urlencode http://php.net/rawurlencode -- Christian Reiniger LGDC Webmaster (http://lgdc.sunsite.dk/) The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence. - Edsger W. Dijkstra -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Strings with Spaces in URLS
$search= urlencode ($search); urlencode - have a look on the php site. -Original Message- From: Chris Aitken [mailto:[EMAIL PROTECTED]] Sent: August 22, 2001 9:05 AM To: [EMAIL PROTECTED] Subject: [PHP] Strings with Spaces in URLS I have come up with a bit of a problem I have a little funky search form on a page, and when I send the search data on as a URL, anything with a space is screwed up example $search = "This is a test"; echo "http://www.blah.com/foo.php?search=$search>"; and when the link is clicked (or even when the mouse is put over the link), the URL in the browser is - http://www.blah.com/foo.php?search=This leaving out all words after the first space. If I simply throw the while thing using the following header statement header("Location: http://www.blah.com/foo.php?search=$search";); then it brings it up properly in the browser. Any suggestions ? Cheers Chris -- Chris Aitken - Administration/Database Designer - IDEAL Internet email: [EMAIL PROTECTED] phone: +61 2 4628 fax: +61 2 4628 8890 __-__ *** Big Brother *** It just shows that the dull will rule the world. And we will be watching it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Strings with Spaces in URLS
> $search = "This is a test"; > echo "http://www.blah.com/foo.php?search=$search>"; You'll want this: echo "http://www.blah.com/foo.php?search=".urlencode($search).">"; ^^ Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Strings with Spaces in URLS
I have come up with a bit of a problem I have a little funky search form on a page, and when I send the search data on as a URL, anything with a space is screwed up example $search = "This is a test"; echo "http://www.blah.com/foo.php?search=$search>"; and when the link is clicked (or even when the mouse is put over the link), the URL in the browser is - http://www.blah.com/foo.php?search=This leaving out all words after the first space. If I simply throw the while thing using the following header statement header("Location: http://www.blah.com/foo.php?search=$search";); then it brings it up properly in the browser. Any suggestions ? Cheers Chris -- Chris Aitken - Administration/Database Designer - IDEAL Internet email: [EMAIL PROTECTED] phone: +61 2 4628 fax: +61 2 4628 8890 __-__ *** Big Brother *** It just shows that the dull will rule the world. And we will be watching it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] STRINGS
THANKS But I fix the problem with other way. Thanks for reply me. Manuel Román VIVA EL ALAVES ("LIFE ALAVES" IN ENGLISH, is the spanish futbol club than yesterday played with Liverpool the UEFA final) ""Plutarck"" <[EMAIL PROTECTED]> wrote in message 9e0lsi$e5v$[EMAIL PROTECTED]">news:9e0lsi$e5v$[EMAIL PROTECTED]... > Take out that first bit with the will work. > > My guess is that you have short-tags enabled in your configuration, and PHP > could be acting screwy there...try sticking an escape character in front of > it like: > > <\?xml > > And see if that works. It might not, but it's all I can see at the moment. > > > Plutarck > > ""Manuel Román"" <[EMAIL PROTECTED]> wrote in message > 9e06qr$pmq$[EMAIL PROTECTED]">news:9e06qr$pmq$[EMAIL PROTECTED]... > > Hi, > > > > How I can save the below string??? > > > > I try concatenate, but when I try with echo or print not display > > nothing. > > > > > > Best Regards > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] STRINGS
Take out that first bit with the wrote in message 9e06qr$pmq$[EMAIL PROTECTED]">news:9e06qr$pmq$[EMAIL PROTECTED]... > Hi, > > How I can save the below string??? > > I try concatenate, but when I try with echo or print not display > nothing. > > > Best Regards > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] STRINGS
Hi, How I can save the below string??? I try concatenate, but when I try with echo or print not display nothing. Best Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Strings in URL
the href should be print "http://www.contus.com/test_quote/quotepage.php3?site=$site&page=miniquote&; subject=$headline'\"> I think.. Tom At 09:41 PM 26/03/01 -0500, Claudia wrote: >I am attempting to pass a string value via a URL. I have tried using >urlencode and ereg_replace--with no luck. > >Here is sample code: > >$headline=urlencode("$headline"); >print "='http://www.contus.com/test_quote/quotepage.php3?site=$site&page=miniquote&; >subject=$headline'>Contact us for more information"; > >Then in the quotepage.php3 file > >if( $page == "miniquote" ) >{ > >print "Get A Quote"; >print "$subject"; >print "$site"; > >INCLUDE "mini_quote.inc.php3"; >} > >--->The print "$subject"; line prints nothing. > >If I print $headline right after I assign the variable it prints correctly >with +s in place of the blanks for this variable. > >Any suggestions? > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Strings in URL
In article <99ou1p$tif$[EMAIL PROTECTED]>, [EMAIL PROTECTED] ("Claudia") wrote: > $headline=urlencode("$headline"); > print " ='http://www.contus.com/test_quote/quotepage.php3?site=$site&page=miniquote&; > subject=$headline'>Contact us for more information"; > > Then in the quotepage.php3 file > > if( $page == "miniquote" ) > { > > print "Get A Quote"; > print "$subject"; > print "$site"; > > INCLUDE "mini_quote.inc.php3"; > } > > --->The print "$subject"; line prints nothing. > > If I print $headline right after I assign the variable it prints correctly > with +s in place of the blanks for this variable. By any chance is that "print" line occuring within a function? The fact that it prints fine then becomes "blank" later sounds like a classic global scope vs. local scope symptom. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Strings in URL
On Tue, 27 Mar 2001 12:11, Claudia wrote: > I am attempting to pass a string value via a URL. I have tried using > urlencode and ereg_replace--with no luck. > > Here is sample code: > > $headline=urlencode("$headline"); > print " ='http://www.contus.com/test_quote/quotepage.php3?site=$site&page=miniq >uote& subject=$headline'>Contact us for more > information"; > > Then in the quotepage.php3 file > > if( $page == "miniquote" ) > { > > print "Get A Quote"; > print "$subject"; > print "$site"; > > INCLUDE "mini_quote.inc.php3"; > } > > --->The print "$subject"; line prints nothing. > > If I print $headline right after I assign the variable it prints > correctly with +s in place of the blanks for this variable. > > Any suggestions? What appears in the first script as the text of the link when you 'view source'? -- David Robley| WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet| http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Strings in URL
I believe you have to urldecode. Try that and see what happens... -jack -Original Message- From: Claudia [mailto:[EMAIL PROTECTED]] Sent: Monday, March 26, 2001 9:41 PM To: [EMAIL PROTECTED] Subject: [PHP] Strings in URL I am attempting to pass a string value via a URL. I have tried using urlencode and ereg_replace--with no luck. Here is sample code: $headline=urlencode("$headline"); print "Contact us for more information"; Then in the quotepage.php3 file if( $page == "miniquote" ) { print "Get A Quote"; print "$subject"; print "$site"; INCLUDE "mini_quote.inc.php3"; } --->The print "$subject"; line prints nothing. If I print $headline right after I assign the variable it prints correctly with +s in place of the blanks for this variable. Any suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Strings in URL
I am attempting to pass a string value via a URL. I have tried using urlencode and ereg_replace--with no luck. Here is sample code: $headline=urlencode("$headline"); print "Contact us for more information"; Then in the quotepage.php3 file if( $page == "miniquote" ) { print "Get A Quote"; print "$subject"; print "$site"; INCLUDE "mini_quote.inc.php3"; } --->The print "$subject"; line prints nothing. If I print $headline right after I assign the variable it prints correctly with +s in place of the blanks for this variable. Any suggestions? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Strings..
Could parse_str() help? >From http://php.net/manual/en/function.parse-str.php: void parse_str (string str [, array arr]) Parses str as if it were the query string passed via an URL and sets variables in the current scope. If the second parameter arr is present, variables are stored in this variable as an array elements instead. -Original Message- From: Ashwin Kutty [mailto:[EMAIL PROTECTED]] Sent: Friday, March 09, 2001 9:04 AM To: [EMAIL PROTECTED] Subject: [PHP] Strings.. Was wondering if someone could tell me how I could do this.. I need the dynamically generated number () from a string, where the string is:- http://blah.blah.com/blah/blah?blah.com/blah=something:%3Asessionid=&db name=blah Now I tried explode and split, with the '&' being as the delimiter, but how do you dump the rest of the string.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Strings..
Was wondering if someone could tell me how I could do this.. I need the dynamically generated number () from a string, where the string is:- http://blah.blah.com/blah/blah?blah.com/blah=something:%3Asessionid=&dbname=blah Now I tried explode and split, with the '&' being as the delimiter, but how do you dump the rest of the string.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strings
[EMAIL PROTECTED] wrote: > > How can i make http://www.something.com/blah/blah.zip into > > blah/blah.zip > > http://www.somethingcom is a constant.. always the same thing > > how can i cut it out? > what comes to my mind right now is str_replace ('http://www.../','',$url) where $url is the full URL. oh, there is also parse_url() :) so what you want would be: $purl = parse_url ("http://.../blah.zip"); $whatiwant = $purl['path']; -- teodor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] strings
str_replace() I think the syntax is $foo = str_replace($old_foo,"http://www.something.com",""); Gfunk - http://www.gfunk007.com/ I sense much beer in you. Beer leads to intoxication, intoxication to hangovers, and hangovers to... suffering. - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 30, 2001 2:41 PM Subject: [PHP] strings > How can i make http://www.something.com/blah/blah.zip into > > blah/blah.zip > > http://www.somethingcom is a constant.. always the same thing > > how can i cut it out? > > thnx > > - Peter > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] strings
How can i make http://www.something.com/blah/blah.zip into blah/blah.zip http://www.somethingcom is a constant.. always the same thing how can i cut it out? thnx - Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Strings??
Ade asked: > I have a form which has 10 fields, is there any way in PHP to take the values > once submitted and create a string for each?? Absolutely. Worse; it is already done for you! If you give the input box a name, and submit to a php page, the php page contains a variable with that name! If the name is 'textbox3' the variable will be called $textbox3. Be careful though; if the variable is not filled in in the form it may not exist. So better test that: if isset($textbox3) echo $textbox3; There's a lot more to forms and variables. In every other tutorial i guess. Chris -- C.Hayes Droevendaal 35 6708 PB Wageningen the Netherlands -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Strings??
PHP automatically makes values submitted in a form available to the next page. aka: form.htm would be: and then in php.php the variable $Field would hold "Field Value" wihtout you having to do anything. So, if php.php were: would print Field: Field Value And I might have done that wrong, I've been doing stuff in ASP the last two weeks and I can't seem to keep them straight anymore. April - Original Message - From: "Benjamin Munoz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, January 16, 2001 4:43 PM Subject: RE: [PHP] Strings?? > Ade, > > What kind of string? What do you want to do with them? > > -Ben > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, January 16, 2001 2:18 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Strings?? > > > Quick Question. > > I have a form which has 10 fields, is there any way in PHP to take the > values > once submitted and create a string for each?? > > Thanks > Ade > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Strings??
Ade, What kind of string? What do you want to do with them? -Ben -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 16, 2001 2:18 PM To: [EMAIL PROTECTED] Subject: [PHP] Strings?? Quick Question. I have a form which has 10 fields, is there any way in PHP to take the values once submitted and create a string for each?? Thanks Ade -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Strings??
Quick Question. I have a form which has 10 fields, is there any way in PHP to take the values once submitted and create a string for each?? Thanks Ade -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]