
Clarkeez
Members-
Posts
70 -
Joined
-
Last visited
Never
Everything posted by Clarkeez
-
$desc = "this is a \"test\" this is a test"; or $desc = 'this is a "test" this is a test';
-
conversion from avi,mpeg to flv using ffmpeg
Clarkeez replied to alimziyan's topic in PHP Coding Help
I'm thinking maybe you could check the filesize before processing the success/error messages. if(!$convert || $outputfileSize == 0kb): echo "error"; else: echo "success"; endif; -
Dear mjdamato You are a star Thanks for you help buddy, you really made it clear for me + I didn't even know array_intersect() exists
-
Ok I think I may know why it's returning false.. Now my needle is array(399, 402, 406, 5350); But, I basically want in_array to return TRUE is it find ANY of these in the needle array.. So I am thinking does in_array try and match ALL in the array to the haystack?
-
It's still returning false. :S
-
Ok.. Thanks for your reply, It makes much more sense not to need a loop as yes, it is just single dimensional. Now, I thought dude, you've got it thanks, then in tried it and it still not finding it... My code is now exactly as you have it (which it correct.) Needle variable is a simple array $conf['guild']['reqAchievements'] = array(399, 402, 406, 5350); Print_r of $charAchievements Array ( [0] => 6 [1] => 7 [2] => 8 [3] => 9 [4] => 10 [5] => 11 [6] => 12 [7] => 13 [8] => 42 [9] => 43 [10] => 44 [11] => 45 [12] => 46 [13] => 73 [14] => 116 [15] => 154 [16] => 162 [17] => 166 [18] => 168 [19] => 199 [20] => 201 [21] => 208 [22] => 212 [23] => 213 [24] => 214 [25] => 216 [26] => 218 [27] => 223 [28] => 227 [29] => 229 [30] => 231 [31] => 238 [32] => 245 [33] => 247 [34] => 263 [35] => 397 [36] => 398 [37] => 399 [38] => 477 [39] => 478 [40] => 479 [41] => 480 [42] => 481 [43] => 482 [44] => 483 [45] => 484 [46] => 486 [47] => 488 [48] => 500 [49] => 503 [50] => 504 [51] => 505 [52] => 506 [53] => 509 [54] => 512 [55] => 513 [56] => 515 [57] => 516 [58] => 522 [59] => 545 [60] => 556 [61] => 557 [62] => 558 [63] => 584 [64] => 587 [65] => 621 [66] => 627 [67] => 628 [68] => 629 [69] => 631 [70] => 632 [71] => 633 [72] => 634 [73] => 635 [74] => 637 [75] => 639 [76] => 642 [77] => 647 [78] => 648 [79] => 649 [80] => 650 [81] => 653 [82] => 657 [83] => 659 [84] => 666 [85] => 686 [86] => 696 [87] => 697 [88] => 699 [89] => 700 [90] => 706 [91] => 727 [92] => 728 [93] => 731 [94] => 732 [95] => 733 [96] => 734 [97] => 735 [98] => 736 [99] => 750 )
-
Heyy ! I'm running into a problem while trying to use in_array($needle, $haystack[$i]) inside a for loop. I get the following error message.. Warning: in_array() expects parameter 2 to be array, integer given in C:\WebSrv\htdocs\inc\form.class.php on line 40 Now here is the code <?php for($i=0; $i <= $charAchievementsCount; $i++): if(!in_array($conf['guild']['reqAchievements'], $charAchievements[$i])): $charMeetsAchievement = false; else: $charMeetsAchievement = true; endif; endfor; ?> Some reason, it kicks that error.. Can't in_array be used within a for loop? Any suggestions ? Thanks
-
Hey.. I am more of a developer than a designer but I have a website that works fine in chrome/FF but it ruined in IE.. Now, do I finish the site in chrome/FF then make it work with IE with seperate or is best practice to make it work with all browsers as I go along... ? Thanks
-
I think I saw captcha on registration and on first post, thats it :S
-
I literally have no idea what you are trying to achieve.
-
Ok, take away mysql_real_escape_string() and try again.
-
$phpgetbrowser is your problem, it's not a valid array. Try break down your functions you've used on the variable.
-
jesus christ im just guna rewrite this project from scratch. it's always the STUPID things that get in my way QQ
-
Are you using Xampp by any chance?
-
What settings is your charset and collation on that db table your using?
-
If I echo the data I get Cóòkíém�
-
PHP Class - What is it for and when to use it
Clarkeez replied to paddy100's topic in PHP Coding Help
Yea, If I were you, I'd learn the code until your a comfy with it first. I had trouble understanding what was the point and why don't I just use function instead etc etc etc.. But when you are ready, check this out, it really helped me -> http://www.phpfreaks.com/tutorial/oo-php-part-1-oop-in-full-effect -
Ok let me give you a better example of what I mean.. Example.. <?php $str = 'Cóòkíémònztr'; $_SESSION['name'] = $str; $q = $db->query(" INSERT INTO names (name) values ('".$_SESSION['name']."') "); ?> Then, when I look in the database, it looks like this.. CóòkÃémà Current settings .htaccess -> AddDefaultCharset utf-8 PHP.INI -> default_charset = "utf-8" HTML -> <meta http-equiv="Content-type" value="text/html; charset=utf-8"> MySQL -> I've tried both utf8_bin and utf8_general_ci
-
Ok.. I'm building a CMS for my guild. One thing that is constantly bugging me and breaking my scripts is if someone enters a character such as ó,í,é etc. I've tried with php.ini has this -> default_charset = "utf-8" I've tried with SQL database and tables set to utf8->utf8_general_ci I've tried with <meta http-equiv="Content-type" value="text/html; charset=utf-8"> on every page load I've tried with SET NAMES utf8; on every SQL connection. The data needs to be stored in a mySQL db and stored in $_SESSIONs, the weird symbols keep breaking my scripts.. What do you guys do to solve this stupid problem?
-
When I was learning the basics, this page helped me greatly. Check it out http://www.w3schools.com/php/php_operators.asp
-
Hey man, try using the function I use for this.. <?php $string = 'blah blah' echo short_str($string, 'maxnumberofcharacters'); function short_str($str, $in) { $strlen = strlen($str); if($strlen > $in): $cutamount = $in-$strlen-3; $out = substr($str, 0, $cutamount); return $out.'...'; elseif($strlen <= $in): return $str; endif; } ?>
-
<?php require("$_SERVER['DOCUMENT_ROOT']."admin/includes/conndb.php"); ?> You have a syntax error, it should be <?php require($_SERVER['DOCUMENT_ROOT']."admin/includes/conndb.php"); ?> good luck
-
http://php.net/manual/en/reserved.variables.server.php Maybe you can use $_SESSION['HTTP_USER_AGENT'] like xyph said and then use str_replace or preg_replace to pull it apart. You'll need to test that variable using different browsers so you can relate the output to different browsers as accurately as you can.