The array_values()
function [docs] does that:
$a = array( 3 => "Hello", 7 => "Moo", 45 => "America" ); $b = array_values($a); print_r($b);
Array ( [0] => Hello [1] => Moo [2] => America
Related Posts:
- Difference between “as $key => $value” and “as $value” in PHP foreach
- Array to String PHP?
- “Notice: Undefined variable”, “Notice: Undefined index”, and “Notice: Undefined offset” using PHP
- Convert a PHP object to an associative array
- How to echo or print an array in PHP?
- Deleting an element from an array in PHP
- How to insert an item at the beginning of an array in PHP?
- what is a good method to sanitize the whole $_POST array in php?
- Sort array of objects by object fields
- In_array not working
- PHP multidimensional array search by value
- Fatal error: Cannot use object of type mysqli_result
- php foreach with multidimensional array
- Convert php array to Javascript
- PHP reindex array?
- php – How do I fix this illegal offset type error
- Mysql where id is in array
- How to convert array to SimpleXML
- Array of PHP Objects
- Is there a function to make a copy of a PHP array to another?
- How to Sort a Multi-dimensional Array by Value
- PHP array printing using a loop
- Fastest way to implode an associative array with keys
- PHP array delete by value (not key)
- PHP Multiple Checkbox Array
- Display array values in PHP
- How to push both value and key into PHP array
- Remove empty array elements
- Replace ' and similar html codes with their correspondent character?
- How to prevent the “Confirm Form Resubmission” dialog?
- navigate back with PHP form submission
- How to fix “Headers already sent” error in PHP
- Loop through an array php
- http://localhost:80 is not working on running Apache server through UniServer ZeroXIII
- How do I get PHP errors to display?
- Get the full URL in PHP
- How to force file download with PHP
- How to Set Category Page as Home Page in Prestashop
- Getting an error when I visit http://localhost
- How can I find my php.ini on wordpress?
- PHP + curl, HTTP POST sample code?
- PHP random string generator
- What are the differences in die() and exit() in PHP?
- Expected status code 200 but received 500
- Can you “compile” PHP code and upload a binary-ish file, which will just be run by the byte code interpreter?
- Invalid argument supplied for foreach()
- Remove the last character from a string
- How to prevent Browser cache for php site
- what does a .php?id=&value=value means?
- Setting up a PHP interpreter in PhpStorm
- Get Current URL in Magento and show something
- Weird PHP error: ‘Can’t use function return value in write context’
- How do I get a YouTube video thumbnail from the YouTube API?
- When to generate a new Application Key in Laravel?
- “Connection for controluser as defined in your configuration failed” with phpMyAdmin in XAMPP
- Call to undefined method mysqli_stmt::get_result
- How to call function of one php file from another php file and pass parameters to it?
- SQLSTATE[HY093]: Invalid parameter number: parameter was not defined
- Is it possible to run .php files on my local computer?
- What does it mean to escape a string?
- Creating default object from empty value in PHP?
- MAMP “Apache couldn’t be started because port is in use.” AND “Can’t connect to local MySQL server through /tmp/mysql.sock
- Php include not working? function not being included
- PHP mail function doesn’t complete sending of e-mail
- phpMyAdmin ERROR: mysqli_real_connect(): (HY000/1045): Access denied for user ‘pma’@’localhost’ (using password: NO)
- SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens on line 102
- What does MYSQLI_NUM mean and do?
- Fatal Error: Allowed Memory Size of 134217728 Bytes Exhausted (CodeIgniter + XML-RPC)
- Laravel 5 Clear Views Cache
- phpinfo() is not working on my CentOS server
- ERROR: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it
- What does double question mark (??) operator mean in PHP
- How can I find the php.ini file used by the command line?
- Check if a PHP cookie exists and if not set its value
- Deprecated: mysql_query() [duplicate]
- Call to undefined function mysql_query() with Login [duplicate]
- How to POST JSON Data With PHP cURL?
- htmlentities() vs. htmlspecialchars()
- PhpMailer SMTP NOTICE: EOF caught while checking if connected
- Facebook – Error parsing input URL, no data was cached, or no data was scraped
- Is there any way to test PHP locally without installing a server?
- PHP Redirect with POST data
- How to use $_SERVER[‘HTTP_REFERER’] correctly in php?
- what is $_SERVER[‘QUERY_STRING’] ? how it works?
- PHP Error : Fatal error: Constant expression contains invalid operations
- JavaScript equivalent of PHP’s in_array()
- Create a folder if it doesn’t already exist
- Implement linked list in php
- Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
- PHP: date function to get month of the current date
- How to make PDF file downloadable in HTML link?
- What is a templating language?
- How to generate .json file with PHP?
- Call to a member function on a non-object [duplicate]
- Generate PDF from HTML PHP
- Call to a member function fetch_assoc() on boolean in
[duplicate] - How to use Memcached with PHP7?
- select count(*) from table of mysql in php
- Auto increment in phpmyadmin
- What does arg mean in WordPress