Jump to content

benanamen

Members
  • Content Count

    1,800
  • Joined

  • Last visited

  • Days Won

    33

benanamen last won the day on May 7

benanamen had the most liked content!

Community Reputation

107 Excellent

2 Followers

About benanamen

Contact Methods

  • Website URL
    http://galaxyinternet.us/
  • Yahoo
    phpfreaks@galaxyinternet.us

Profile Information

  • Gender
    Not Telling
  • Interests
    Email me at phpfreaks@galaxyinternet.us

Recent Profile Visitors

3,880 profile views
  1. benanamen

    running windows and linux side by side on s notebook

    Simplest thing to do is install VirtualBox and load Linux in a Virtual Machine
  2. benanamen

    How can I align digit

    function MaFonction($x){ for ($i=0 ; $i<=360 ; $i+=$x){ echo sprintf("%02d", $i) . " ==> " . deg2rad($i) . "<br />"; } } MaFonction(15 );
  3. benanamen

    Parse error: syntax error, unexpected ';' line 44

    The proper syntax is not else, else, else.... https://www.php.net/manual/en/control-structures.elseif.php
  4. benanamen

    Echoing all $_GET values

    Just use var_dump if you just need to see what the array contains.
  5. benanamen

    Join or Union?

    The the left join would have worked if you switched the tables around.
  6. benanamen

    Join or Union?

    You would do a JOIN on ProspectID
  7. benanamen

    Laravel vs raw php code

    It never hurts to learn new things. There are plenty of Laravel tutorials out there. Make sure the tutorial matches the version of Laravel you will be using or you will get stuck, as substantial changes have been made between particular versions.
  8. benanamen

    Laravel vs raw php code

    It depends. Do you want to learn how to code or do you want to learn how to use Laravel? Read the manual and watch the Laracast videos they provide. You should really learn the basics of coding before you attempt a Framework.
  9. benanamen

    Can’t figure out what’s wrong with this array

    It' simple really. You are providing an array, it matches the 1 and returns back to the caller so the rest of the if's are not processed. Try this... <?php declare(strict_types=1); function property_structure_type ($data) { if (in_array("1", $data)) { return "House"; } if (in_array("2", $data)) { return "Cabin"; } if (in_array("3", $data)) { return "Mobile Home"; } if (in_array("4", $data)) { return "Apartment"; } if (in_array("5", $data)) { return "Condominium"; } if (in_array("6", $data)) { return "Townhome"; } if (in_array("7", $data)) { return "None"; } } echo property_structure_type ([2]);
  10. benanamen

    Is there a way to simplify this code?

    A minor comment. This line if(count($result_contest) > 0) Can simply be if($result_contest) The return value for fetchALL is either an array with results or an empty array, or false on failure. There is no need to count anything. The default truthy check of the if is all you need.
  11. benanamen

    Arrays: concatenation operator .= vs =

    Well..., if that isn't a "how about that" LOL. I get the explanation by Andrea, but still.......
  12. benanamen

    Arrays: concatenation operator .= vs =

    Just a reminder, in PHP 7 with strict_types, the second parameter of print_r MUST be a boolean and not an integer or it will fail with a fatal error. Correct <?php declare(strict_types=1); echo '<pre>', print_r($array, true), '</pre>'; Fails Fatal Error <?php declare(strict_types=1); echo '<pre>', print_r($array, 1), '</pre>'; Fatal error: Uncaught TypeError: print_r() expects parameter 2 to be boolean, integer given TypeError: print_r() expects parameter 2 to be boolean, integer given It does "work" but it will give you an Undefined variable notice. It doesn't matter if it is an array or not.
  13. benanamen

    array in mysql database?

    The \ is escaping the /. Why is your data in the DB like that in the first place?
  14. benanamen

    Cant figure out PHP/MySQL Error

    No. https://dev.mysql.com/doc/refman/8.0/en/logical-operators.html
  15. benanamen

    JSON naming convention

    You pretty much covered it in the first sentence so I will just tell you what my standard is. snake_case = DB Columns, Variable Names & Function Names (same as Php. i.e: set_exemption_handler) camelCase = OOP methods, method calls, & OOP Properties PascalCase = Class Names. (i.e: class UserAccount) dash-seperator = Filenames (For SEO i.e: my-file.php)
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.