}
background-color: #f0f0f0;
th {
}
text-align: left;
padding: 10px;
border: 1px solid #ddd;
th, td {
}
border-collapse: collapse;
table {
Stock Quotes and Market Information
Stay up-to-date on the latest stock quotes and market trends with Petersen Custom Farming.
| Symbol |
Name |
Current Price (CAD) |
Change (%) |
Open Time |
Close Time |
High/Low |
loadHTML($response);
// Extract stock quotes and calculate change percentage
$quotes = $soup->getElementsByTagName('tr');
foreach ($quotes as $quote) {
$row = $quote;
// Get current price, change percentage, open time, close time, high, low
$price = $row->getElementsByTagName('td')->item(1)->nodeValue;
$change = $row->getElementsByTagName('td')->item(2)->nodeValue;
// Close and high/low values are not always available, so skip them for now
if ($change) {
list($open_time, $close_time) = explode(' - ', $row->getElementsByTagName('td')->item(3)->nodeValue);
// Format change percentage as a string with two decimal places
$formatted_change = number_format(floatval($change / 100), 2);
// Create the stock quote row
echo "| $symbol | Name | Current Price (CAD) | Change (%) | Open Time | Close Time | High/Low |
";
echo "" . $price . " |
" . $formatted_change . "% |
" . $open_time . " - " . $close_time . " |
$symbol |
NaN |
$symbol |
";
}
}
} else {
echo "Error: Unable to fetch stock data.
";
}
?>
Market Trends and Insights
Petersen Custom Farming is committed to providing the latest market trends and insights to help you make informed decisions about your investments.
| Category |
Trend |
loadHTML($response);
// Extract market trend categories and trends
$categories = $soup->getElementsByTagName('tr');
foreach ($categories as $category) {
$row = $category;
// Get category name and trend description
$name = $row->getElementsByTagName('td')->item(1)->nodeValue;
$description = $row->getElementsByTagName('td')->item(2)->nodeValue;
// Create the market trend row
echo "| $name | $description |
";
}
} else {
echo "Error: Unable to fetch market trend data.
";
}
?>
https://www.petersencustomfarming.ca:443//markets/stocks.php?article=pressadvantage-2024-9-30-fence-depot-assures-wildwood-quality-fences-with-renewed-local-focus