473,813 Members | 3,723 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to print out the first value in array after asort($array)

65 New Member
my problem is after asort($array) then i want to print out the first value of the array?
Like this array([1] => april [3] =>free [0]=>ghost [2]=>key)

I notice that the first index number is not a zero...and my problem is always print the first value only without know the index number..

Can some one guide me..Thanks
May 16 '07 #1
2 1690
shidec
26 New Member
try this

Expand|Select|Wrap|Line Numbers
  1. reset($array); // reset pointer, go to first element
  2. echo current($array); //print current element
  3.  
May 16 '07 #2
wish
65 New Member
thank so much..it is work in my application...t hank you
May 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2139
by: Alvaro G Vicario | last post by:
I have this test code: <html><pre><? echo "Versión: ".phpversion()."\n\n"; $define_list = array( 'PRODUCT_LIST_MODEL' => 0, 'PRODUCT_LIST_NAME' => 0,
1
2160
by: praba kar | last post by:
Dear all, In Php array_slice function base we can print array contents as per our desire eg) $a = array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); $arr = array_slice($a,10,10); this function will print 11,12,13,14,15
1
1524
by: Ellen Manning | last post by:
The main report shows all medical conferences for a resident by year, by month. A resident can attend many of the same conferences in a year. In the year footer, I have a subreport that summarizes all conferences and the number of times attended. This data is stored in an array that is updated during the printing of the report detail. I cannot do a simple grouping/counting of conferences. For some conferences, the resident has to be...
5
3232
by: Robert Oschler | last post by:
I am converting a Perl script over to "C" for a potential open source project. I need some open source "C" code that will give me the same functionality of a Perl Style associative array: someArray = 6; I know I can't get the same syntactic sugar as Perl offers, with the usage of a string as the array key surrounded by square brackets. I just want the general functionality, that's all. That is, a data container that will maintain...
1
1884
by: kieran | last post by:
Hi, I have a string Array called Groups and this has x number of groups. Each row of the Array is divided up by ';' and has the name of the group in the second position (i.e. after the first ';') and then x number of values all divided by ';'. All these subsequent values are the IDs of the contacts of the group I then have a second string Array called Contacts and this has x number of contacts.
10
6541
by: Ocean | last post by:
I'm a novice on ASP using VBScript, and I encountered a problem when I want to get and use a return value of a web method in my ASP code. There is a web method called "getQuote", which takes a string indicating the symbols as its parameter, and return an array of "BTQuote" objects which contain the info of every symbol respectively. Also, there is a proxy object which is generated automatically by the IDE. This proxy object is wrapped...
1
1610
by: Neil Chambers | last post by:
I'm currently using multidimensional arrays in PoSH by assigning values to index positions. I'm doing this because AFAIK there is no way to initialise an array simply with the 'number' of dimensions required. So, for example, I would initialise an array with 3 x 2 dimensions thusly: $myArray = @((1,2),(3,4),(5,6)) $myArray 5
3
4850
by: katak | last post by:
hi... 1. how to do ranking value in array ? let said i hv 200000 sets of data need to store in an array after that i need to do ranking for the 200000 sets of data and find out the top 20 sets smaller value in array over total set of data (200000 sets of data) . 2. what is maximum space(size of array) for an array in 1D , and 2D ?
2
2500
by: Karthik Prasath | last post by:
after finishing my problem given by my head and the values are stored in the array and i want to print that in a applet window.. how can i proceed? help me with sample program advance thanks for you looking forward for your reply
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10426
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10141
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9225
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6897
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3886
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3030
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.