Results 1 to 10 of 12
If I wanted to print out
Code:
<?php ?>
how can I do this? I was using echo "\<\?php \?\>" but it doesn't work. Reading through the manual, I don't ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 07-17-2003 #1Linux Engineer
- Join Date
- Nov 2002
- Location
- Queens, NY
- Posts
- 1,319
Printing out characters
If I wanted to print out
how can I do this? I was using echo "\<\?php \?\>" but it doesn't work. Reading through the manual, I don't see how I can achieve this.Code:<?php ?>
The best things in life are free.
- 07-17-2003 #2Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
What do you mean? Through PHP code or through HTML? HTMl would be easy:
If you mean through PHP code, this works for me:Code:<?php ?>
Of course, the <>'s will make your browser not display it since it will think that it is HTML. So I guess that what you really want is a combination.Code:print("<?php ?>");
- 07-17-2003 #3Linux Engineer
- Join Date
- Nov 2002
- Location
- Queens, NY
- Posts
- 1,319
Got it. A combination such as print( "<?php >" ) should suffice. Not that this pertains to this problem but is it just me or do you too find scripting languages harder to write and debug?
The best things in life are free.
- 07-17-2003 #4Linux Guru
- Join Date
- Apr 2003
- Location
- London, UK
- Posts
- 3,284
As opposed to what?
Originally Posted by bpark
I think any language, providing you know it well and your code is well structured etc is easy to debug and write.
Obviously there are differences between what each language will allow you to do, even finding a good, consistent coding style can help a lot.
Jason
- 07-17-2003 #5Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
I'd say it depends. The thing is, of course, that there isn't any debugger for PHP, which makes it a lot harder than debugging any language that eg. gdb can handle. The same goes for many other scripting languages as well, like perl and bash scripting. It is a bit simplified by the fact that the PHP engine gives verbose errors as opposed to a C program that might just segfault on you. That's why it depends, since it can make some simple situations really easy to debug.
- 07-18-2003 #6Linux Engineer
- Join Date
- Nov 2002
- Location
- Queens, NY
- Posts
- 1,319
Well,
This past week, I was writing simple CGI scripts in PERL. I think I was missing one character and it kept on giving me a very dull message about how the code is wrong or that the system admin needs to give me permissions. I looked at that code for about 20 minutes before I realized that a hash array's starting body brace was typed with a '{' instead of a '('.
Thinking about this type of error, perhaps I find g++ or gcc's output better since I'm used to programming in those languages. The PERL problem has been taken care of but I must say that PHP's error detection is pretty good at giving the user where the error lies within the code.The best things in life are free.
- 07-18-2003 #7Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
Indeed, the compiling errors may be clearer when using gcc, but runtime errors can be really hard to work out, espacially if they're one-shot.
- 07-18-2003 #8Linux Engineer
- Join Date
- Apr 2003
- Location
- Sweden
- Posts
- 796
Yes i think the PHP errormessages are pretty good, Perl is a bit worse. Does anybody know if i can execute my perlprograms with any debug-flag?? like in shellscripting sh -x <shellscript> to see exactly where the program goes wrong??.
That would make the world easier....Regards
Andutt
- 07-18-2003 #9Linux Guru
- Join Date
- Oct 2001
- Location
- Täby, Sweden
- Posts
- 7,578
Are you referring to perl -w?
- 07-19-2003 #10Linux Engineer
- Join Date
- Nov 2002
- Location
- Queens, NY
- Posts
- 1,319
Even with 'perl -w', unless you are using it from the command line and specifying the parameters, it will not give you a good description at all.
The best things in life are free.


Reply With Quote
