how to modify text from within a php script.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
5leander5
Forum Commoner
Posts: 31
Joined: Thu Mar 09, 2006 3:45 am

how to modify text from within a php script.

Post by 5leander5 »

Can someone please tell me how to modify text from within a php script.

For instance, how can I make the following text centred and red

Code: Select all

<?php
echo "how can i make this red and centred?";
?>
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Re: how to modify text from within a php script.

Post by neophyte »

You don't use PHP to change the color, use CSS...
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

or simple html. <center><font color="red"> ;)
5leander5
Forum Commoner
Posts: 31
Joined: Thu Mar 09, 2006 3:45 am

Post by 5leander5 »

I've setup some CSS styles but cannot applt them to my php scripts. How do you do this? For instance, how can I apply one of my style sheets to the following code?

Code: Select all

<?php 
session_start();
ob_start();?>
<html>
<head>
<title>Expression Of Interest</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {color: #FF0000}
.style3 {color: #FF0000; font-size: 10px; }
-->
</style>
<link href="bert2.css" rel="stylesheet" type="text/css">
</head>

<?php
if(isset($_SESSION['Submit'])){ 
echo "Please complete the mandatory fileds. Thank you.";
}
?>
?>
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Code: Select all

echo "<p class=\"style1\">text</p>";
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
NightFox
Forum Newbie
Posts: 13
Joined: Sat Mar 11, 2006 3:20 am

Post by NightFox »

Ya, or just:

Code: Select all

echo "<p class='style1'>text</p>";

Code: Select all

echo "<span class='style1'>text</span>";
Post Reply