buffering, something like:
function ob_highlight_file($filename)
{
ob_start();
highlight_string($filename);
$source = ob_get_contents();
ob_end_clean();
return $source;
}
Be sure to pay attention to notes and warnings within the
PHP manual.
Regards,
Philip Olson
I meant to use highlight_file instead of highlight_string, doh!
I'll go back in time and modify the source below :)
Philip
On Thu, 4 Apr 2002, Philip Olson wrote:
A note exists at http://www.php.net/highlight_file that says:
Note: The return parameter became available in PHP 4.2.0
or otherwise.
Regards,
Philip Olson
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
(please!).
When in doubt, put error_reporting(E_ALL) on top of your
script and go to town.
Regards,
Philip Olson
On Tue, 2 Apr 2002, Erik Price wrote:
On Tuesday, April 2, 2002, at 03:27 PM, Philip Olson wrote:
If you're distributing code in cyberspace it's a good
idea to make it error
#ini.error-reporting
A function also controls this behavior within scripts,
it's appropriatly named error_reporting()
http://www.php.net/error_reporting
So, start programming your code with error_reporting(E_ALL)
and have fun!
Regards,
Philip Olson
p.s. Although it's fairly common to create
, mysql_error() is your friend.
Regards,
Philip Olson
On Tue, 2 Apr 2002, menezesd wrote:
Hello Friends.
I know I am asking for too much. But somehow, I am stuck
with three books I am refering and still not being able to
solve my problem, which I would greatly appreciate if any
to something other then AS, like
perhaps authors or something ;) Also eventually
learn about Database Normalization.
Regards,
Philip Olson
OK. I use:
while ($mydata = mysql_fetch_object($news))
{
$authors = explode(;, $mydata-AS);
}
Then why Invalid argument supplied for foreach
, MYSQL_ASSOC);
Or just use mysql_fetch_assoc(). Regarding extract(), if this is the
desired affect (as proposed in the original question), then:
SELECT foo FROM bar
extract($row);
print $foo;
Now, mysql_fetch_row is _slightly_ faster then both of these but
who's counting.
Regards,
Philip Olson
This sounds like a job for include_once
www.php.net/include_once
regards,
Philip Olson
On Wed, 30 Jan 2002, Bas Jobsen wrote:
Hello,
I have this:
?
include(file1);
function_somename();
include(file2);
function_somename();
?
file1 and contain a function definition
include_once() won't help. In fact, he is including each file only once.
He wants to have a function with the same name in each file. That's the
kicker...
oh well that's silly, don't do that. also consider function_exists()
regards,
Philip Olson
--
PHP General Mailing List (http
Have a look around:
http://www.php.net/strip_tags
Regarding simple matches, consider:
http://uk.php.net/stristr
And who knows, maybe you want:
http://us.php.net/htmlspecialchars
Learn about if/else:
http://au.php.net/else
Regards,
Philip Olson
On Fri, 25 Jan 2002, Leif K-Brooks
while/list alternatives:
http://www.php.net/manual/en/control-structures.foreach.php
Your question was answered below but I couldn't resist throwing in a
little array propaganda, jic :) Arrays work great in forms too!
http://www.php.net/manual/en/faq.html.php#AEN73718
Regards,
Philip
Are you referring to the change with 4.1.0 that's documented in the
manual? Have another look, it gives examples of new/old behavior:
http://www.php.net/strtok
Regards,
Philip Olson
On Sun, 13 Jan 2002, Robert Mena wrote:
Hi, does anybody know when the strtok bug introduced
in 4.1.1
:))
This is documented now which is as best we can do at this point. That and
clearly document all BC breaks in the future. I vow to help on the
documentation end.
Regards,
Philip Olson
On Mon, 14 Jan 2002, Manuel Lemos wrote:
Hello,
I don't disagree, but the fact is that doesn't help anybody
(). Also for good measure, you may want to check if $file
is_writable() first.
Regards,
Philip Olson
p.s. Please keep questions to one thread.
On Sun, 13 Jan 2002, Andrew V. Romero wrote:
I have been working on a script that manipulates arrays and now I am
working on the part where the user can
[a]; // banana (no error)
Because constants are not looked for within strings, the following is
appropriate:
print an $arr[a]; // an apple
As are:
print an {$arr['a']}; // an apple
print an . $arr['a']; // an apple
Anyway, maybe that helps explain a few things :)
Regards,
Philip Olson
--
PHP
sendtohost()
http://dodds.net/~cardinal/sendtohost.txt
regards,
Philip Olson
--
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]
of the above but I got a bit carried away :) Oh,
mysql_error() can be very useful for debugging. Regarding the type
resource, have a look here:
http://www.php.net/manual/en/language.types.resource.php
Regards,
Philip Olson
On Fri, 4 Jan 2002, louie miranda wrote:
Hi, is it possible to print
This will only work with PHP 4.1.0 or later.
Consider this example:
$letter = 'a';
$i = 0;
while ($i++ 26) {
print Letter: . $letter++ .\n;
}
regards,
Philip Olson
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e
I seriously doubt your code works -- have you tested it? I think the code
you submitted will most probably output 1 2 3 4...24 25 26 (spaces are
actually \n's). I never tested it though, so I may be mistaken.
Yes, it works. Test it before posting such doubts :)
Regards,
Philip Olson
. Btw, consider something like:
$str = '123456789abcdef';
$bad = array('B','P','H','O');
if (in_array(strtoupper($str{11}),$bad)) {
echo 'boo';
}
I can't believe people code on Christmas :)
Warm regards,
Philip Olson
--
PHP General Mailing List (http://www.php.net
.
If an error stumps someone, searching the archives (or google) for the
error can be helpful. For example:
http://marc.theaimsgroup.com/?l=php-generals=headers+already+sent
http://www.google.com/search?q=php+%22headers+already+sent%22
Anyway, what was the question again? :)
Regards,
Philip
time. Check your error_reporting setting
*shrugs* See the email I just posted.
Ah it's always something thanks much.
Yep :)
Regards,
Philip Olson
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
variables section of manual and
phpinfo().
regards,
Philip Olson
On Tue, 25 Dec 2001, Edward Marczak wrote:
Hello!
Two items in the new 4.10 change-log caught my attention:
*Introduced a new $_REQUEST array, which includes any GET, POST or
COOKIE variables. Like the other new variables
vars will be listed and described in the manual eventually (fairly
soon). For now, read the above release notes.
Regards,
Philip Olson
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact
Anyway to reverse the effect of htmlspecialchars?
See the docs found here:
http://www.php.net/manual/en/function.get-html-translation-table.php
Shown there is a way to do this.
Regards,
Philip Olson
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL
() in php manual too.
Regards,
Philip Olson
On Fri, 21 Dec 2001 [EMAIL PROTECTED] wrote:
if you have a PHP page and you want to use SSI in it... is there a special
method?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e
see:
http://www.php.net/manual/en/function.mail.php
a link to a tutorial/rfc exists there. also, check the various script
archives for mail packages, most allow for attatchments.
regards,
Philip Olson
On 22 Dec 2001, Dasmeet Singh Arora wrote:
Is it possible to send attachments using
In pseudo-code:
function makeyogurt ($flavour, $type = 'EMPTY ARRAY')
{ }
function makeyogurt ($flavour, $type = array()) {
...
}
or
function makeyogurt ($flavour, $type = array('a','b')) {
...
}
regards,
Philip Olson
--
PHP General Mailing List (http
reliable word count although it won't be perfect.
For examples on posix regex (which is taken on by split), see:
http://www.phpbuilder.com/columns/dario19990616.php3?print_mode=1
regards,
Philip Olson
On Sat, 22 Dec 2001, Bharath Bhushan Lohray wrote:
?php
$line = no more words to say;
$word
Try virtual()
http://uk.php.net/virtual
Something like:
virtual('cgi-bin/ssirand.cgi?REGION=Sports');
regards,
Philip Olson
On Fri, 21 Dec 2001, Nick wrote:
Well the include line I needed was this:
!--#include virtual=/cgi-bin/ssirand.cgi?REGION=Sports --!
That didn't work
,
Philip Olson
On Thu, 13 Dec 2001, Alok K. Dhir wrote:
With PHP 4.1.0, all calls to is_dir which would have returned false now
report a stat failed warning as a bonus. Using @is_dir to quiet it
for the time being, but I'd imagine this is not the desired effect
Alok K. Dhir
what command? if you're using ini_set you can't. in this case it'll set
the local value but it's of no consequence, register_globals has already
done its thing before getting to the script. use of .htaccess is
possible.
regards,
Philip Olson
On Thu, 13 Dec 2001, Charlie Killian wrote:
I
://www.php.net/manual/en/install.unix.php
regards,
Philip Olson
On Sun, 25 Nov 2001, Phil Ewington wrote:
Hi,
As I have only ever worked on a Windows platform, installing PHP MySQL on
a RAQ3 is completely alien to me. I attempted to install the binaries by
following instructions I dug up
unix timestamps. A hack can be created but let's try to avoid
that :)
regards,
Philip Olson
On Sat, 24 Nov 2001, neeraj wrote:
Hi List,
!! Please help !!
My problem,
1) My Start time for a xyz file is 11.15 am 14-11-2001
2) My End Time for xyz file is 01.20 pm 14-11-2001
3) Total
What does the (ampersand) before the variable name mean ?
It's called a reference, check out:
http://www.php.net/manual/en/language.references.php
regards,
Philip Olson
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands
perhaps you want to do the following:
function foo($str) {
return explode(' ',$str);
}
$required = foo('name address phone');
regards,
Philip Olson
On Tue, 20 Nov 2001, Brandon Lamb wrote:
Here is the php version
$required = array('name','address','phone');
Here is the perl
See:
http://www.php.net/manual/en/function.mail.php
an example lives there. The key here is that additional headers, such as
From: will go in the optional additional_headers parameter.
Regards,
Philip Olson
On Tue, 20 Nov 2001, Ben Clumeck wrote:
I am new to PHP. I am trying to specify
,
Philip Olson
On Tue, 20 Nov 2001, Jeff Lacy wrote:
Hello,
Does anyone have a good function or ideas about address standardization? I
need some form of it in a web-app I am trying to write, but I don't know
where to begin.
Thanks,
Jeff
--
PHP General Mailing List (http://www.php.net
Hi Justin,
That man page is pretty descriptive and contains many examples. It's
sorta like a tutorial :) If there is information you (or anyone) feels is
missing, please say so and it'll be looked into and perhaps added.
Regards,
Philip Olson
On Fri, 2 Nov 2001, Justin French wrote
then $arr if the number
of elements is odd, otherwise they'll be equally sized halves. Using
ceil() as opposed to floor() will make $second_half the smaller of the
two.
Regards,
Philip Olson
On Wed, 31 Oct 2001, Daniel Harik wrote:
Want to split it in half
1 Big array:
1
2
3
4
5
6
'];
Not suggesting these names be used as array keys though :) Regarding
reserved words, they can be seen here:
http://www.php.net/manual/en/reserved.php
Regards,
Philip Olson
On Wed, 31 Oct 2001, CC Zona wrote:
In article 01A4B59FD1EBD311838100A0C98BE0D9AD5D91@chef,
[EMAIL PROTECTED
4.0.2 and is in
the process of being updated.
regards,
Philip Olson
On Tue, 23 Oct 2001, Steve Cayford wrote:
So both include() and require() *are* subject to conditional statements
in the code? Guess I missed that.
Thanks.
-Steve
On Tuesday, October 23, 2001, at 01:00 AM, Rasmus Lerdorf
This is not possible. Default values cannot be set with type=file as if it
were it would be quite a security risk.A little more information on
the capability of this html form element:
http://www.blooberry.com/indexdot/html/tagpages/i/inputfile.htm
And a related RFC :
Here's an example :
http://www.php.net/manual/en/configuration.php?foo=bar#ini.include-path
It works.
Regards,
Philip Olson
On Tue, 2 Oct 2001, Ralph Guzman wrote:
Never had to do this, however I would think the correct way to be:
a href=page.php#bottom?location=01
try
sounds like it's time to repartition your HD, or get a new HD, or linux
box ... install a flavor of linux and try it out locally. in the long
run, this will be the most fun anyways :-)
Regards,
Philip Olson
On Wed, 3 Oct 2001, ReDucTor wrote:
But that doesn't have an option to search
;
Regards,
Philip Olson
On Wed, 3 Oct 2001, Dominik wrote:
Through php, I run a function that creates a list of items in a select menu
as follows:
select name=menu
option value=? echo $item1; ?Item 1/option
option value=? echo $item2; ?Item 2/option
/select
but here is how the source code
essentially does the same thing.
Regards,
Philip Olson
On Wed, 3 Oct 2001, [iso-8859-1] René Fournier wrote:
A little problem with single quotes messing up an SQL SET statement...
I can type single quotes, double quotes--it seems, any 'special'
character--into a form, and so long as my PHP
the
example :
http://www.php.net/fread
regards,
Philip Olson
On Wed, 3 Oct 2001, Nikola Veber wrote:
Hi !
I'm having a problem with the following : I have a log file on my site, that records
date,
time and the user's system. Each entry is placed in a new line. Now, I can only read
the first
Hi Job. This works for me (and *should* always work) :
$a = array('foo' = 'bar');
$b = array('b' = 'foo');
print $a[$b['b']]; // prints bar
How _exactly_ are you calling it? (provide a short standalone ex)
Does the above example work for you?
What version of php?
regards,
Philip
that
looks like :
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in /www/htdocs/test.php on line 4
As it does. The Warnings shown above refer to the E_NOTICE level. Have
fun and yes, this is a digression and off-topic :)
Regards,
Philip Olson
1
here, $arr['foo'] will not.
$foo isn't as pretty as $foo
regards,
Philip Olson
On Wed, 26 Sep 2001, Richard Baskett wrote:
I can not figure out why this is not working!
for ($j=0; $j$resultNum; $j++) {
$newvar = finalresult.$a;
$$newvar[$a][name] = $resultRow[name];
$$newvar
Here's one way :
$bye = 'jennifer lopez';
foreach ($cart as $title = $value) {
if (!strcasecmp($value,$bye)) {
unset($cart[$title]);
break;
}
}
Btw, it's = not ==, jennifer not jannifer :)
regards,
Philip Olson
On Thu, 27 Sep 2001, Sijan Khadka wrote:
How can we remove
to cookie tutorials in there too.
regards,
Philip Olson
On Thu, 27 Sep 2001, Murat wrote:
hi,
i think -i've read- private sites which has login scripts (have username and
password) are made using cookie. if this is true, how can find the
information about making like that sites? if not, how
://marc.theaimsgroup.com/?l=php-generalm=100152166602273
regards,
Philip Olson
On Thu, 27 Sep 2001, Web user wrote:
System: PHP4.06 + Mysql3.23.41 Win32 + Apache 1.3.20 Win32 + Win98
When PHP is running at the line: $arr=mysql_fetch_array($res);
The IE always show info as below:
Parse error
See :
http://www.php.net/manual/en/function.get-html-translation-table.php
An example exists in there that does this.
Regards,
Philip Olson
On Tue, 25 Sep 2001, Jay Paulson wrote:
hello-
Is there a built in function that will reverse what htmlspecialchars() does
to text
be of most use to you, it contains
examples to do about anything with $HTTP_USER_AGENT.
Also, check out the get_browser() function :
http://www.php.net/manual/en/function.get-browser.php
Although it takes a little work to get running :)
Regards,
Philip Olson
On Tue, 25 Sep 2001, wm wrote:
hi all
through accordingly. see :
http://www.mysql.com/doc/M/a/Mathematical_functions.html
for more details.
regards,
Philip Olson
On Wed, 26 Sep 2001, Matthew Delmarter wrote:
Hi Lawrence,
Thanks for your reply.
I should clarify that I want to control where I output the result.
Place 1 - show
(). you should
get comfortable with arrays too. also, look into stristr().
regards,
Philip Olson
On Mon, 24 Sep 2001, Kyle Smith wrote:
Is i possible to make PHP CUT all of the contents of a text document out of it and
make it into a variable?
(yes i know, i havnt got to the mySQL section
, either fix the code (yeah!) or use the error_reporting()
function to suppress the warnings. Strange that a free host would have it
on, actually, it's kinda cool :)
regards,
Philip Olson
On Mon, 24 Sep 2001, Justin Colson wrote:
I have recently installed Apache 1.3.2 and PHP 4.0.6 using
$bar = 'abc';
function foo() {
global $bar;
$bar = 'def';
}
foo();
echo $bar; // def
http://www.php.net/manual/en/language.variables.scope.php
regards,
Philip Olson
On Tue, 25 Sep 2001, Peter wrote:
Hi,
I am have a function in which I have created a variable in it called
contents into a string. fgets() is nice because you don't have to
gets the entire file, sticking a break; in there during a match can be
uber cool :-)
If this is being done locally then of course don't go through http:// ...
Regards,
Philip Olson
On Sun, 23 Sep 2001, Simon Roberts wrote:
Check
It's being worked on, go here :
http://www.php.net/mirrors.php
Replacing www with your county code (uk,us,au...) usually works too. For
example, the uk mirror is uk.php.net
regards,
Philip Olson
On Sat, 22 Sep 2001, Lukas wrote:
Hello,
hey is it just me or is the manual on the PHP
('(gif|jpg|png|jpeg)$',$str)) {
print 'yes, variable $str ends with gif, jpg, png or jpeg';
}
warm regards,
Philip Olson
On Thu, 20 Sep 2001, Andras Kende wrote:
Hi,
I trying to cut the last 4 char of a string but sometimes its cut 3 sometime
4 char
$pic1=$amyrow[picture
;
}
}
?
/tr
/table
Regards,
Philip Olson
On Wed, 19 Sep 2001, Kurth Bemis wrote:
i'm trying to get a chunk of code to look 5 times then print
something..then look 5 time more
I really want to loop 5 times (making 5 cells) then print /trtrthen
loop 5 more times for 5
] = b
print_r($bar);// [0] = a [1] = c
?
Regards,
Philip Olson
On Thu, 20 Sep 2001, Miroslav Figlar wrote:
Hi,
what is the best way to delete element from an array?
Suppose i have an array called $numbers:
$numbers = array(a = 10, b = 20, c = 30, d = 40);
I want to delete
/language.variables.predefined.php
Regards,
Philip Olson
On Tue, 18 Sep 2001, Ingo wrote:
hello
i am using win2000 xitami, php and access. so my problem is that the script
couldn't find the variable.. .
so i cant save the user changed buttons and editfields...
is that a known problem
be useful. I'd personally avoid output buffering
for this.
Regards,
Philip Olson
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
/language.variables.external.php
Configuration : error_reporting :
http://www.php.net/manual/en/configuration.php#ini.error-reporting
Hope that helps, good luck :)
Regards,
Philip Olson
On Tue, 4 Sep 2001, Uchendu Nwachukwu wrote:
OK, I have a problem calling a function using default variables
);
$seed = TRUE;
}
// weak error checking mechanism
if ($len 1 || !is_numeric($len)) $len = 8;
$chars_len = strlen($chars);
for ($a=1; $a = $len; $a++) {
$tmp .= $chars{mt_rand(0,$chars_len)};
}
return $tmp;
}
That was fun :)
Regards,
Philip Olson
On Sat, 1 Sep 2001, bill
';
print $string[0]; // depreciated (might not work one day, when?)
vs.
print $string{0};
Both print 'a' though.
Regards,
Philip Olson
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact
is
not defined (i.e. use 'quotes')
$arr['key'] // Warning if key 'key' not defined
See :
http://www.php.net/manual/en/phpdevel-errors.php
http://marc.theaimsgroup.com/?l=php-generalm=99486381324867
Much more can be said, hope the above helps.
Regards,
Philip Olson
looks bright.
--
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]
function is array_keys and array_search. see :
http://www.php.net/array
regards,
Philip Olson
On Fri, 31 Aug 2001, Andrey Hristov wrote:
from http://php.net/quickref.php
$os = array (Mac, NT, Irix, Linux);
if (in_array (Irix, $os)){
print Got Irix;
}
Andrey
Sounds like you want to do :
$guiness = 'Thick and Creamy!';
$beer= 'guiness';
print ${$beer}; // Thick and Creamy!
Regards,
Philip Olson
On Fri, 31 Aug 2001, Nikola Veber wrote:
I am having big troubles here. I wrote this code just as it said in the manual, and
it prints
is case insensitive, strstr is case sensitive. modify to suit
your needs.
regards,
Philip Olson
On Fri, 31 Aug 2001, Joseph Bannon wrote:
What about going the other way? Say I have a sentence...
Hi, my name is Bob.
...and I want to search the sentence for one of the values (people
btw, you may want to search for a name surrounded by spaces as philip vs
philips, jim vs jimmy, etc. probably other considerations as well, or
maybe not :)
philip
On Fri, 31 Aug 2001, Philip Olson wrote:
try this :
$people = array ('philip','sasheen','jim');
$string = 'Hi, my name
}} = 'crazy';
print $a; // prints crazy
Regards,
Philip Olson
On Fri, 31 Aug 2001, Papp Gyozo wrote:
$GLOBALS[substr($string, 0, 1)]
or :
$tmp = substr($string, 0, 1);
${$tmp} = 'add whatever value you want';
- Original Message -
From: Stig-Ørjan Smelror [EMAIL
see :
http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=foo
http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=bar
pretty interesting :)
regards,
Philip Olson
On Wed, 29 Aug 2001, Seb Frost wrote:
Why is it that every example uses foo and bar. In my head I put these
together to get
/manual/en/language.operators.errorcontrol.php
example :
if (@is_file($file_name))
Regards,
Philip Olson
On Wed, 29 Aug 2001, John Meyer wrote:
It seems to have slipped me little mind, but how do you suppress error messages?
--
PHP General Mailing List (http://www.php.net
hi friends,
Can someone post here the most efficient method to validate a variable
as numeric? I see a ton of hacks/ways in the manual user comments under
is_int, is_integer and is_numeric and would like to see just one or two
good solid ones. And please, no regular expressions :)
Regards,
see :
http://www.php.net/strstr
http://www.php.net/stristr
Regards,
Philip
On Tue, 28 Aug 2001, Brandon Orther wrote:
Hello,
I have a variable with a string in it. I want to check if in that
string a certain word is in it. Example
$var = This is a good sentence;
$check =
Your $categoryarry is a 2d array, try :
print_r($categoryarry);
But, I think you want to do :
$categories = array('Sasheen','Tom','Fred');
Now, if you do this :
while(list($key,$value) = each($categories)) {
print $key : $value\n;
}
You'll get :
0 : Sasheen
1 : Tom
2
,
Philip
On Tue, 28 Aug 2001, daniel james wrote:
do you mean, as in,
if !is_integer($var) {
print($var is not an integer);
}
--- Philip Olson [EMAIL PROTECTED] wrote:
hi friends,
Can someone post here the most efficient method to
validate a variable
as numeric? I see a ton
About the simplest way to accomplish what you want is :
pre
?php print_r($var) ?
/pre
\newlines don't show up in browser but will in the source, check your html
source and see how pretty it is (full of newlines).
Here's an example :
$string = a\nb\nc\n;
print $string;(newlines in
variable and string functions exist :
variables : http://php.net/manual/en/ref.var.php
strings : http://php.net/manual/en/ref.strings.php
Regards,
Philip Olson
On Thu, 16 Aug 2001, Brandon Orther wrote:
Hello,
I am looking for a way to check a string if it has anything other than
Numbers
Have a look here :
http://php.net/manual/en/language.types.type-juggling.php
http://php.net/manual/en/function.settype.php
regards,
philip
On Tue, 7 Aug 2001, Don wrote:
Hi,
I'm looking at the 'String' section of the online documentation. I cannot
find a function that converts a
Also keep in mind that sometimes spaces find their ways into the string
and using trim() will get rid of them. Something like :
if (strcasecmp('neo',trim($name)) == 0) {
echo 'You chose our Neo line of goods, way to go!';
}
Not to say spaces randomly attach to strings :-) but to be
Please everyone, stop talking about this it's getting old. If you have
issues with a list member, take it off the list. We, your fellow list
members, don't want to hear about it.
Publically making fun of someone isn't cool but rather, it's stupid.
Regards,
Philip
--
PHP General Mailing
Hi Kyle,
Yes, one such ultimate tutorial exists, it's called the PHP Manual. It's
large and nice and contains many examples and user comments. If you find
it scary, try out some less ultimate tutorials first. Go through the
tutorials on devshed.com phpbuilder.com zend.com and related
See :
http://www.php.net/manual/en/ref.session.php
Note the use of $HTTP_SESSION_VARS within the examples, this may be what
you're referring to.
Regards,
Philip
On Wed, 1 Aug 2001, Jon Yaggie wrote:
is there not an array that saves all session variables? I just got
done looking for it
Sometimes I walk outside and wonder why the sky is blue.
On Wed, 1 Aug 2001, Michael J. Seely wrote:
HI FOLKS,
Imagine you had a PC Laptop, PHP installed, and a Ricochet/Sierra
Wireless AirCard 400 - 128 kbps NIC card.
What boom pow applications can you imagine setting up and
See what this does within your code :
$count = mysql_result($result,0);
Should give you your count (number of users in db). Btw, don't escape
single quotes in double quotes. In otherwords, the following is fine :
$string = I'm a nice string;
See :
Maybe you should just install a package, much easier. Check out :
http://hotscripts.com/PHP/Scripts_and_Programs/Installation_Kits/
phpTriad and nusphere are popular, as are others. Once it's setup play
with the configurations, etc. Usually mysql/apache/php will be installed.
Regards,
A couple possible reasons :
1. Mixing \n and br
\n won't create a newline within your browser but rather it will within
your html source code. Meaning, look at your html source and notice the
newlines.
2. Using single quotes
echo '\n'; will literally print '\n', in otherwords, it won't
Read this :
Using Strings :
-
http://www.zend.com/zend/tut/using-strings.php
Notice :
echo This will give a parse error to us;
echo This will not give a \parse error\ to us;
echo This won't either;
echo
I disagree with this post. A simple sentence or two would have been much
more useful then a slandering reply.
Regarding the question, here's a simple example :
mail('[EMAIL PROTECTED]','subject','message','From: [EMAIL PROTECTED]');
More can be found here :
A PHP faq resource :
http://php.faqts.com/
Regarding an official faq, searching the archives works pretty well.
Here's a great place to start (one of many places php-general is
archived) :
http://marc.theaimsgroup.com/?l=php-general
Or actually, google archives everything forever :
Just for the sake of completing this thread, variable functions can be
read about here :
http://www.php.net/manual/en/functions.variable-functions.php
Regards,
Philip
On Tue, 31 Jul 2001, scott [gts] wrote:
im sorry, but i was trying to do that the hard
way. i figured out how to execute
Try putting mysql_error() in your die statements so :
or die(mysql_error());
and see what it tells you.
Regards,
Philip
On Tue, 31 Jul 2001, CGI GUY wrote:
Is there anything (add. parameters, etc.) that I'm
missing that would possibly explain why the following
code won't execute?
301 - 400 of 599 matches
Mail list logo