-
Posts
15,262 -
Joined
-
Last visited
-
Days Won
431
Everything posted by requinix
-
Go through the lines in the file and keep track of (=store in an array) the lines you actually want to choose from. Then array_rand() on that.
-
Try something more like foreach ($array as $key => $value) { if ($value is an array) { $return = recursive search on $value; if ($return means that the search found the value) return $return; } else if ($value matches the search value) { return whatever you want; } }
-
Trying To Get Button Inside Anchor Tag to Valididate in HTML5
requinix replied to jimmyoneshot's topic in HTML Help
A tags are anchors (and inline). Use a DIV instead (which is block). -
can't connect to mysql server on 'localhost' 10061
requinix replied to nephesh's topic in MySQL Help
mysqld is the server process: that needs to be running before you can connect to it. -
Do you need to specify a "category" in that $arg2?
-
copy works too.
-
Isn't accessing a static variable from a non-static function bad?
requinix replied to AFTNHombre's topic in PHP Coding Help
That syntax is bad, yes. Accessing them in general is fine, but the way to do it is self::$FormatType Yes, PHP is tolerating the code, but somewhere it's creating warning messages (even if you can't see them). -
$offers is an array of offers. $object = array( "pages" => 2, "offers" => $offers ); JSON-encode that.
-
#194#160 is the UTF-8 encoding of a non-breaking space. So decode it first, remove the whitespace, and re-encode it.
-
You don't need more code for this. $max = min(array($sym, $res)); There. Do you understand it now? If you don't ever want $naq to be the minimum then don't include it in the list.
-
Is it possible to make a function that can generate a function?
requinix replied to hockey97's topic in Application Design
I would love to hear the actual problem you're trying to solve. The one that you think this generating-functions-at-runtime stuff is the solution to. Because honestly: this is all silly. There are much better ways. -
Use SimpleXML and an XPath query. If there's only the one in the whole document, //int[@name='reqJob']
-
number_format() doesn't quite do what you're expecting. Try round instead.
-
Is stripping out the HTML tags an option?
-
PHP 6 was scrapped. There are no plans for it whatsoever. Anything said about it is meaningless.
-
One per second? See, this is why I asked and didn't just give you a blind answer. You don't need AJAX for that. Pure JavaScript will be fine. Set an interval for every one second, and when your function fires increase the counter. That's all.
-
Are you using mysqli_connect()? Are you sure $dbc is an open connection?
-
You don't have to parse it yourself. SimpleXML will do that. If you don't know how to use it, check the manual for examples.
-
First word is "AJAX". Second word is generally like "auto-populate" or "auto-generate" or something like that. But basically it's just AJAX. When the one list changes you do an AJAX request to find out what should go in the next list. (And then you put the items in there.)
-
What are you counting? At (about) what rate does it normally increase?
-
Certainly possible. Start with SimpleXML.