Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
Just check if it's empty. if(empty($whatever)) { echo "It's empty or null"; } else { echo "It isn't empty or null"; } That should do.
-
Damn, that's a lot of replies...
-
I think you can use unlink() on directories, but only if they're empty. You could just do exec("rm -rf {$directory}"); though. Edit: No, you can't use unlink(), you must use rmdir() (must still be empty though).
-
No, there is no such thing as fr-gb or es-de or ja-fr or whatever... Or perhaps you're looking for the IETF language code and not ISO? It has the syntax you are requesting... first a required ISO-639(-1) language code optionally followed by a dash and a ISO-3166 country code. It's mentioned in RFC 2612 Section 3.10 Language Tags and in the HTML specification.
-
Gmail, Google Docs, Google Calendar etc. require Javascript... Well, Gmail does have a HTML only version, but it's not nearly as good.
-
Just remember to call the parent constructor (or destructor) if you override it in a child class, unless you want to completely override it, but that's not the case in your posted code.
-
I use it when necessary, yes.
-
Are you looking for the ISO 639-1 codes?
-
I agree with GingerRobot. I think it's perfectly okay to require some sort of prerequisites. How else would you create advanced or intermediate tutorials if you require ANY user to understand everything (even people who haven't seen a PHP script before)?
-
We need to see some of the source in order to help you find it.
-
That'll just increase the load time because the page will not be presented to the user before the script is finished executing. If set it to sleep for 20 seconds then it'll just take 20 seconds more before the page loads. Do as said in the post above me.
-
There shouldn't be a problem with that code (other than the names of the classes). What do you mean with having h1 not have any styling?
-
Well, "Beast of the Day" is a header (title), so it should have a header tag. I'd probably give your main title (BEAST IT) the <h1> tag and then put the text BEAST IT inside it and use CSS to display an image instead. In that way search engines would for example still be able to read your title. Next I'd give titles like "Beast of the Day" <h2> tags. Inside that box you have titles like "Picture of the Beast", that would then be <h3>. And so forth... It also helps on SEO as you'll build up a sort of structure of the site. If you choose "Show outline" on W3C's validator, then you can see it: http://validator.w3.org/check?uri=http%3A%2F%2Fbeastit.com%2Findex2.htm&charset=%28detect+automatically%29&doctype=Inline&group=0&outline=1 This is what you're able to semantically extract from your page: http://www.w3.org/2005/08/online_xslt/xslt?xmlfile=http%3A%2F%2Fcgi.w3.org%2Fcgi-bin%2Ftidy-if%3FdocAddr%3Dhttp%253A%252F%252Fbeastit.com%252Findex2.htm&xslfile=http%3A%2F%2Fwww.w3.org%2F2002%2F08%2Fextract-semantic.xsl
-
Echoing a variable which isn't set until later in the file?
Daniel0 replied to hatrickpatrick's topic in PHP Coding Help
Don't do so (if it's even possible). Initialize the variables BEFORE using them. -
What I posted before wasn't an opinion What d22552000 did was incorrect. See: http://php.net/types.array#language.types.array.foo-bar
-
No it isn't... you are using a constant as the array index. It will work because PHP makes it a string with the value of the constants name if it isn't set. It gives you an E_NOTICE. Do $user3['topic'] instead.
-
Echoing a variable which isn't set until later in the file?
Daniel0 replied to hatrickpatrick's topic in PHP Coding Help
I never heard of a such thing... were would you do that? I don't see it in php.ini Don't attempt to do so though, it would be bad programming practice. -
@MadTechie: Good job copying from this page: http://www.faqts.com/knowledge_base/view.phtml/aid/1/fid/40 which is linked to from http://php.net/print Yes.
-
Well, this is jcomb's web page (so his profile says at least). Web development is his WORK. I doubt web development is YOUR work. Besides, he is not discriminating.
-
The font is apparently called Silkscreen.
-
I have one file for testing: /var/www/test.php and C:\apache2\htdocs\test.php (yeah, I know it's two!!) That's the file(s) I use for testing. That includes if I want to test anything I post here.
-
You could put it before the closing script tag (</script>) in the <head> tag. Note that in the code you posted you only wrote </script
-
An E_STRICT is not an error. It's just if PHP thinks you should do it in another way. It's perfectly valid to ignore E_STRICTs. You would for example have to use var if you are creating a script which is to be released and you want to ensure that it can be run by users whose host is using PHP4.