-
Posts
1,832 -
Joined
-
Last visited
-
Days Won
3
Everything posted by salathe
-
This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=311729.0
-
See http://php.net/operators.logical and in particular the very first paragraph (and the link mentioned at the end of it).
-
Integration with Facebook (Facebook Connect)
salathe replied to xeronix's topic in PHPFreaks.com Website Feedback
The point, of the first paragraph at least, was to troll. There isn't a team of developers here, at least nothing that those who manage the site know anything about. My second paragraph still stands. I see absolutely no benefit in integrating Facebook Connect with this site. Indeed, in a recent post made by yourself, you bemoan those large, social networking sites as screwing the little guys like us. Don't get me started on having the ability to "like" threads here. -
I'm calling bull. Pardon me for being blunt but how does a hardware failure require a drastic and completely unannounced (even after-the-fact) increase in the number of ads on the site? Why do you suddenly need double (whether literally, or it just feels like that) the income; I was under the impression the advertising as-was more than covered the outgoings? I'd rather see other, likely more lucrative, monetisation ideas put forward than filling my page (every, single, darned, page) with more and more adverts... if cash really is so tight, that is. I'd say it was also good to see you, Eric. But it's not. (Nothing personal!)
-
Hi Eric and you, dear reader, What's going on with the ads here, there seems to be a marked increase in the number of them on the forums and the main site. Are you running short on cash (thus wanting more subcribers, who happily don't see the ads) and/or just, to put it crudely, wanting to be more annoying to your regular-joe visitors? Of course it's your site to monetize, a little heads up would be nice though. I don't really care too much about the visitors (dear reader, I'm joking... honestly, I care about you) but more about any real need for more funds coming in to PHPFreaks. Yours patiently, Sally
-
Integration with Facebook (Facebook Connect)
salathe replied to xeronix's topic in PHPFreaks.com Website Feedback
PHPFreaks has "other developers", pahahaha. Please, don't implement Facebook Connect: if folks find username/password (with "remember me"!) too much like hard work then what on earth are they doing on a developer forum? -
I don't know what you mean by "the biggest", but it is used by lots of companies including ones with lots of people developing for them, and is used by companies making a lot of money. Did you think it was some framework only for hobby coders? Of course it is helpful else it would be a pretty awful framework. As for "more professional" to use a bespoke framework, I'd argue there is no answer (at least as far as "yes" or "no" is concerned) to that.
-
This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=311437.0
-
For what it's worth str_getcsv was (literally) written for this purpose.
-
Please describe your problem more clearly and thoroughly. Making up new restrictions, constraints or related-issues isn't conducive to helping us to help you out.
-
Neither is better nor worse. They're just two ways of looping. Choose whichever you find gets the job done best, or at all.
-
$first = (int) $currentIds[1]; $second = (int) $currentIds[2];
-
What does var_dump($currentIds); look like?
-
gmdate will get the correct time in GMT... however that is not what you want (obviously). There are a couple of ways, here's two. // I'm assuming this is the timezone you really want // It could also (instead) be set in a .htaccess or php.ini file date_default_timezone_set('Europe/London'); $now = date($format); $now = date_create('now', new DateTimeZone('Europe/London'))->format($format);
-
How does your last post relate to the original question?
-
Did you RTFM? See the note on that page between the 2nd and 3rd paragraphs.
-
For what it's worth, the parentheses around [a-e] are entirely superfluous and there is no real need for the other pair to be capturing anything.
-
if (count(array_unique($array)) <= 1) { ... The logic being; if there is only one unique item (or, no items) then they are all the same. Your last sentence confuses things, do you really want to check if the array contains just 1 (possibly, many times)?
-
Here's a brief example which uses preg_replace_callback and a bespoke callback function to replace the tags with one of the words at random. function choose_word($match) { $options = explode('|', $match[1]); return $options[array_rand($options)];}$subject = "{Cats|Dogs|Mice} and a {Monkey|Chimp}";$phrase = preg_replace_callback('/{([^{}]+)}/', 'choose_word', $subject);echo $phrase;
-
Hi eian, please see my replies on Sitepoint.
-
No. That will evaluate to FALSE.
-
Did any of you even read the question? /^\d{0,5}$/D \d matches any single digit (0 through 9) and {0,5} means to match from zero up to a maximum of 5 of those digits. Alternatively, you could use [0-9] in place of \d. ^ and $ and D in combination mean that the pattern will match a string, only if the pattern matches the entire string. /^[a-zA-Z0-9 ]{0,48}$/D Hopefully you can work out the above for yourself. Some good places to look for help: http://www.regular-expressions.info/quickstart.html - a basic introduction to regular expressions http://php.net/pcre - using PCRE regular expressions in PHP http://pcre.org/pcre.txt -the manual
-
/<meta name="keywords" content="(.*)?"(?: \/)?>/i
-
Alternative File function for wildcard extension
salathe replied to andytan91's topic in PHP Coding Help
For what it's worth, in reply to ProjectFear, you could move the job of checking the file name into the glob itself... glob("Audit_Report*.txt") -
Being a guru has nothing to do with intellectual stature, just look at Cags me!