What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » PHP Array Help

PHP Array Help
Author: Message:
stoshrocket
Senior Member
****

Avatar
formerly methos

Posts: 748
Reputation: 31
34 / Male / Flag
Joined: Aug 2005
O.P. RE: PHP Array Help
quote:
Originally posted by SonicSam
php code:
<?php

$one = "monkey";
$two = "baguette";

>>> $one_array = array_map('rtrim',file('one_list.txt')); <<<
>>> $two_array = array_map('rtrim',file('two_list.txt')); <<<

if (in_array($one,$one_array)) {
    echo"one present!<br />";
    if(in_array($two,$two_array)){
        echo"two present!";
    }
    else{
    echo"two missing!";
    }
}
else{
    echo"one missing!";
}

?>

rtrim — Strip whitespace (or other characters) from the end of a string
array_map — Applies the callback to the elements of the given arrays

i won the game

http://sonicsam.net/quest.php

YAY! You win! Have a cookie [Image: cookie.gif]

Thankles very much Sam! =)
formerly methos
02-19-2009 10:51 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
PHP Array Help - by stoshrocket on 02-19-2009 at 09:07 PM
RE: PHP Array Help - by matty on 02-19-2009 at 09:14 PM
RE: PHP Array Help - by prashker on 02-19-2009 at 09:16 PM
RE: PHP Array Help - by matty on 02-19-2009 at 09:21 PM
RE: PHP Array Help - by prashker on 02-19-2009 at 09:42 PM
RE: PHP Array Help - by stoshrocket on 02-19-2009 at 10:51 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On