Jump to content

Dragosvr92

Members
  • Posts

    276
  • Joined

  • Last visited

Everything posted by Dragosvr92

  1. Sorry but i havent understood your question right. $YearArr = array( 1 => '19', 2 => '19', 3 => '18', 4 => '18', 5 => '20', 6 => '20' ); I have the array above. The keys 1 and 2 must output 19, if selected. I want to remove the duplicates. I think it is easy to understand.
  2. I just want to remove the duplicates. Number 1 or 2 means/echoes 19. Same for the others. Thanks for the fast answer !
  3. I have this array which has double contents. $YearArr = array( 1 => '19', 2 => '19', 3 => '18', 4 => '18', 5 => '20', 6 => '20' ); Would it be possible to remove the repeating data, and make it look like something like this? $YearArr = array( 1/2 => '19', 3/4 => '18', 5/6 => '20' ); Thanks
  4. That looks pretty awesome Samuz ! Nice to see a full HTML5 website. I would fix this silly error if i were you.. Line 20, Column 34: The align attribute on the h1 element is obsolete. Use CSS instead. <h1 class="title2" align="center">Jerri Hart</h1>
  5. Yes, it is solved. I wasnt used with the new forum software, and havent noticed the solved button.
  6. Because that number is in an Romanian Social Security Number format, and i wanted to extract all the data out of it, for personal use. I finished the script when i got the Age script from the previous topic i posted in.
  7. Thank You salathe ! I managed to make my script display the full year (Y, not y), and the script works better.
  8. I have a script that outputs the birthyear in the dd.mm.yy format. Example 15.02.92. Does anyone have a clue how may i calculate the age against the current, autogenerated date? I just want the straight age. Not the Day/month. But i wouldnt mind if it does both. Thanks in advance. PS: This is the second topic i create on this new forums. Does it still use SMF? The "Textarea" which seems to be an iframe, and not a textarea is annoying me. I dont have the copy/paste menu when i right click in it. The undo option is also a bit screwy.
  9. Because that long number means something, and i need to extract the data in it. Thank you spfoonnewb.
  10. I dont understand.... So i have this array : Array ( [1] => 1 [2] => 23 [3] => 45 [4] => 67 [5] => 89 [6] => 002 [7] => 4 ) I need to make an array for each index, and output the matching data. If [1] outputs 1, then it should replace 1 with male, and 2 with female. I would prefer to do this from an array of : Array( [1] => Male [2] => Female ) Something like: <?php $gender = $match[1]; if($gender == "1"){echo"Male";}else{echo"Female";} ?> Do i make any sense?
  11. Thank you both. I will go for the cleaner version's preg match, and use the shorter if statement. Is there any documentation of the preg_match things used to split something? I dont know how they work at all. Also, do you know how may i replace $match[5] aka 89 with a word that is found inside another array of words? The word inside the array would have the number 89. Should i use an if statement, or some str/preg_replace ....?
  12. I am looking into splitting a number of this format "1234567890024" in an array that would look like this: Array ( [0] => 1 [1] => 23 [2] => 45 [3] => 67 [4] => 89 [5] => 002 [6] => 4 ) I had a look at str_split, but it doesnt seem to allow you to split a number in different numbers..
  13. Thank You very much Dan. Sorry for my late reply.
  14. And i need to output the date using mktime() to output the timestamp. the timestamp is what i need, not the date.
  15. With c it outputs 2008-03-03T20:26:00+00:00 With A it outputs PM/AM This is my Code: <? if (isset($_POST['DATE'])) { $str = $_POST['DATE']; $chars = preg_split('/[-:, ]+/', $str); $timestamp = mktime($chars[3], $chars[4], '00', $chars[0], $chars[1], $chars[2]); echo date('m-d-Y, h:i A', $timestamp); echo '<br />', '<br />'; echo $timestamp; } ?> I just need to make an array and replace for example 08 with 20, so that the time may be set as PM. I think you are getting confused :-\
  16. Thanks Dan, but that doesnt look like what i need. I Made the script myself, but i have a problem on detecting if its either morning or night, using mktime(). For example there may be 03-05-2008, 02:17 AM, and 03-05-2008, 02:17 PM. A solution i thought about would be to make some if statement and check if PM is selected, and if it is, check an array and if it finds, for example: " 03 " it replaces it with " 15 ". here is some lame script i made..... $chars[5] outputs PM/AM $chars[3] outputs the hour <?//AM if ($chars[5]=='AM' || $chars[3]) { array{ "01" = "13"; "02" = "14"; "03" = "15"; "04" = "16"; "05" = "17"; "06" = "18"; "07" = "19"; "08" = "20"; "09" = "21"; "10" = "22"; "11" = "23"; "12" = "00"; } } ?> Can you please give me a example?
  17. It took me a few hours to figure it out, and make it, after i last posted,but i have done it using preg_split() as i needed to split it by the 3 symbols => - , :
  18. Thank you, i will look at that tomorrow. I didnt thought on using explode() I remembered why i had to use a input for each area and didnt made it like this
  19. Well that was very helpful..
  20. Hello, i need a fast convertor that converts the date format 03-03-2008, 08:26 PM into a timestamp fast. Like, you paste 03-03-2008, 08:26 PM into a post form, submit and it gives you the time stamp. I made a convertor a whille ago, but you need to insert each numbers into a separate input box (day, months, year etc) I cant remember how exactly it functions etc asi haventtouched PHP In a while.....
  21. PHP Gets parsed/generated inside the server, then outputs HTML, CSS, Javascipt etc.. Whever it is set to do. After the PHP functions/strings/whatever gets read/interpreted by the server, it outputs what you proggramed it to do. That is why its said its Server side scripting, same as Apache etc.
  22. Figured it out myself.
  23. Hello, yesterday i have added Google search on my site, and i am having a little trouble with placing the imput form. This is the page with the issue is And this is how i'd lke it to look like: I have no idea why the form element wouldnt stay on the same line, as both things (google ads and form) are on the same td element. Could anyone please have a look and see how may i get it to look right? Thanks in advance.
  24. hi thorpe, i meant what kicken said. kicken, you are right. there are databases, but they arent free, i thought a php functioon may be able to do that. nevermind.
×
×
  • 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.