Jump to content

Andy_Kemp

Members
  • Content Count

    21
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Andy_Kemp

  • Rank
    Member
  1. In Wordpress there is this code <?php $user_info = get_userdata(1); echo 'Username: ' . $user_info->user_login . "\n"; echo 'User roles: ' . implode(', ', $user_info->roles) . "\n"; echo 'User ID: ' . $user_info->ID . "\n"; ?> My question is how they get this? $user_info->user_login My code class Config { private $db; public function __construct($db) { $this->db = $db; } public function get() { $query = 'SELECT * FROM config'; $select = $this->db->query($query); $config = array(); while ($row = $
  2. <?php declare(strict_types = 1); function test(string $username, int $age, float $price) : array { return array('Username' => $username, 'Age' => $age, 'Price' => $price); } $_get = array( 'username' => '', 'age' => '', 'price' => '', ); $_get = array_merge($_get, $_GET); print_r(test($_get['username'], $_get['age'], $_get['price'])); I am new with php7 So when i looked those examples i see test('test_username', 20, 20.01) but int and float are absolutely useless with $_POST, $_GET, Its always error. WITH int - must be of the type integer, string
×
×
  • Create New...

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.