Search found 16 matches
- Wed Nov 24, 2004 9:44 am
- Forum: General Discussion
- Topic: Travelling at the speed of light....
- Replies: 7
- Views: 1193
I mean theoretically, if it were possible to observe a car zooming past you at the speed of light, then it switched its headlights on, surely you wouldn't see a difference even though the driver does? I'm no scientist and got what little I know from what little I read of The Elegant Universe, but in...
- Tue Nov 23, 2004 11:23 am
- Forum: General Discussion
- Topic: Travelling at the speed of light....
- Replies: 7
- Views: 1193
Come on now folks, the speed of light is weird in that it is constant to all observers, so the headlights would work normally from your point of view. To a stationary observer however the car and the headlights would be going at the same speed, whatever that would look like... probably just a car wi...
- Fri Nov 19, 2004 5:54 am
- Forum: PHP - Code
- Topic: Resizing JPG / JPEG
- Replies: 4
- Views: 702
GD can be slightly complicated to get used to, but the most common way to resize JPEGs using it is like this <?php $src = ImageCreateFromJPEG ($src_filename); $width = ImageSx ($src); $height = ImageSy ($src); $x = $new_width; $y = $new_height; $dst = ImageCreateTrueColor ($x, $y); ImageCopyResample...
- Thu Nov 18, 2004 3:51 pm
- Forum: PHP - Code
- Topic: [Solved]Array comparison
- Replies: 9
- Views: 1055
- Thu Nov 18, 2004 9:00 am
- Forum: PHP - Code
- Topic: Forms: Submit to two at once?
- Replies: 2
- Views: 342
- Thu Nov 18, 2004 8:18 am
- Forum: PHP - Code
- Topic: [Solved]Array comparison
- Replies: 9
- Views: 1055
I have to admit I'm still not too sure what you're after, but it looks like you could use a bit of [php_man]array_intersect[/php_man], see if this is what you want: <?php if ($cat = current (array_intersect (array_keys ($categories), $query_string_array))) print_r ($categories[$cat]); ?> (PS in case...
- Mon Nov 15, 2004 3:25 pm
- Forum: PHP - Code
- Topic: Convert db encoding
- Replies: 4
- Views: 708
- Fri Nov 12, 2004 8:11 am
- Forum: PHP - Code
- Topic: Removing \n and tabs?
- Replies: 4
- Views: 379
Alternatively it may be quicker to use an array with [php_man]str_replace[/php_man] like this:
Code: Select all
<?php
$chars = array (' ', "\t", "\r", "\n");
$text = str_replace ($chars, '', $text);
?>- Mon Nov 08, 2004 1:26 pm
- Forum: PHP - Code
- Topic: reading a random quote
- Replies: 13
- Views: 956
- Mon Nov 08, 2004 12:57 pm
- Forum: PHP - Code
- Topic: JPEG Image Upload
- Replies: 5
- Views: 536
To create a thumbnail from the uploaded JPEG try this: <?php $src = ImageCreateFromJPEG ($src_filename); $width = ImageSx ($src); $height = ImageSy ($src); $x = $desired_width; $y = $desired_height; $dst = ImageCreateTrueColor ($x, $y); ImageCopyResampled ($dst, $src, 0, 0, 0, 0, $x, $y, $width, $he...
- Mon Nov 08, 2004 12:47 pm
- Forum: PHP - Code
- Topic: Help with = $_SERVER['REMOTE_USER']
- Replies: 2
- Views: 751
Do you mean $_SERVER['REMOTE_ADDR'] or maybe $_SERVER['REMOTE_HOST'] for info on the machine accessing the script. If you want info on the server the script is running on then maybe you want $_SERVER['SERVER_NAME']. There are a load more too, check them out here http://www.php.net/manual/en/reserved...
- Mon Nov 08, 2004 5:05 am
- Forum: PHP - Code
- Topic: converting array into a string
- Replies: 2
- Views: 237
Try using [php_man]implode[/php_man] - eg...
Code: Select all
<?php
$array = array (3, '435', 5, 886, 'sdr');
$string = implode (',', $array);
?>- Thu Nov 04, 2004 8:11 am
- Forum: PHP - Code
- Topic: Get text from another website
- Replies: 3
- Views: 812
- Wed Mar 03, 2004 10:25 am
- Forum: PHP - Code
- Topic: Session variables gets flushed!!
- Replies: 9
- Views: 799
- Wed Mar 03, 2004 9:06 am
- Forum: General Discussion
- Topic: Beta testing a web site!
- Replies: 7
- Views: 1637