Jump to content

ronnievanderstegen

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by ronnievanderstegen

  1. Hi I wanted to open, read and close a file using following code: <?php $filename="test.txt"; $handle= fopen ($filename, "r"); $contents=fread($handle,filesize($filename)); fclose ($handle); ?> This file is located in the map: /users/sites/test.txt But opening the .php file on my local browser doesn't do a thing. I only get a blanc screen. I thought that file permission could be the problem, but I don't know what to change. Does anyone have any experience with this on Mac and how to solve it? Thanks already.
  2. Thanks already for the answers. I'm relatively new to php, if it isn't to much trouble, could you please post the right code?
  3. Hi I want to make a table that has table rows like this: There are 3 horses in the sky. There are 4 cows in the stable. There are 5 dogs in the sea. The numbers, the animal names and the places have to be placed neatly below each other, so therefore I probably need to use the <td></td>. I tried using the printf ($format, $number, $animal, $place) function, and the array's $number=array(3,4,5); $place=array(sky,stable,sea); $animal=array(horses, cows, dogs); But I only get one tablerow that says (, There are, Array, Array, in the, Array); Can anyone please tell me what code I have to use to make this? Thanks already.
  4. Hi In the program Numbers on mac I have a column with prices but they are displayed in different shapes, like this: 1.000,00 1.000.00 1000.00 1000,00 1000 I found this code to use the function floatval() <?php function floatvalue($value) { return floatval(preg_replace('#^([-]*[0-9\.,\' ]+?)((\.|,){1}([0-9-]{1,2}))*$#e', "str_replace(array('.', ',', \"'\", ' '), '', '\\1') . '.\\4'",$value)); } ?> Can anyone tell me if I can use this function to make all numbers look like 1000.00? If so how to do this? Is it possible to use the function on a column in Numbers (for Mac)? If so, how to do this? Thanks already for the help.
  5. Hi Just starting with php... This is the first part of the code: <?php $bestek = array ('vorken' => 5, 'messen' => 6, 'lepels' => 7); $servies = array ('borden' => 5, 'kopjes' => 6, 'schalen' => 2); $keuken = array ('bestek' => $bestek, 'servies' => $servies); echo '<table border=1>'; foreach ($bestek as $key => $value) { echo "<tr>"; echo "<td>". $key."</td>"."<td>".$value."</td>"."<br>\n"; echo "</tr>"; } foreach ($servies as $ke => $valu) { echo "<tr>"; echo "<td>". $ke."</td>"."<td>".$valu."</td>"."<br>\n"; echo "</tr>"; } echo "</table>"; ?> Printing the array's $bestek and $servies is not a problem, but now I want to print the $keuken-array in a table. Can anyone please help me with the code for that? I tried several things, but the result always is: Bestek Array Servies Array Thanks already for your help.
×
×
  • 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.