PHP embedding functions inside strings?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting PHP embedding functions inside strings?
# 8  
Old 08-30-2012
OK hold it. What I was looking to do before was reading in an HTML file, make transformations to it in a PHP file, then print the resultant HTML.

I didn't want to mix the HTML and PHP into the same file because I was afraid you wouldn't be able to edit the HTML/PHP hybrid file with an HTML editor like MS Word (where you edit the HTML document as if it's a word document). But it looks like I might be wrong. Looks like Word is ignoring the PHP.

Ultimately I want everything to display in a browser, and the PHP is not being ignored there which is good.

---------- Post updated at 08:13 PM ---------- Previous update was at 07:47 PM ----------

Nevermind it's not ignoring the PHP

Last edited by stevensw; 08-29-2012 at 11:58 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to execute functions or initiate functions as command line parameters for below requirement?

I have 7 functions those need to be executed as command line inputs, I tried with below code it’s not executing function. If I run the ./script 2 then fun2 should execute , how to initiate that function I tried case and if else also, how to initiate function from command line if then... (8 Replies)
Discussion started by: saku
8 Replies

2. UNIX for Advanced & Expert Users

Embedding code into ssh keys

Hi Its been a long time since I worked with ssh keys containing embedded shell commands and cannot remember how it is done. Does anyone know of any sites that have a good tutorial on the subject? I'm not having much luck searching Google for it. Incidentally, searching this forum for the... (6 Replies)
Discussion started by: steadyonabix
6 Replies

3. Shell Programming and Scripting

Difficulty embedding variable within AWK

Hi, I am working on a parsing script but cannot figure out how to accomplish this. Here is a simplified version of the script: #!/bin/bash DS=$1 DS=`expr $DS \* 2` DS=`expr $DS + 7` cat $FILENAME | awk '/<row><v> +/' | awk '{printf("%.0f %.0f\n", $6, $9)}' The problem is that I want the... (2 Replies)
Discussion started by: Nisrak
2 Replies

4. Shell Programming and Scripting

Embedding HTML in Perl script

My webpage is hosted from perlscript(homepage.pl), i want to add piece of html code in the footer of the homepage. I simply pasted the html code at the end of the perl script as below... ======================================================== close(OUTSQL); ... (4 Replies)
Discussion started by: paventhan
4 Replies

5. UNIX Desktop Questions & Answers

Embedding file output into a script

Hello. I found a Unix script on this site that calculates a date that is 2 months earlier from today. I'm using that script and writing the value to a file called 2monthsago.txt. I want to use that value in another script. Below is my attempt at doing that and the results. My Script: ... (1 Reply)
Discussion started by: Colel2
1 Replies

6. Shell Programming and Scripting

CSH: Concatenating Strings, how to add new line character and functions?

Hello, I'm trying to run a program on a directory (traverse sub dirs too) through my csh script. Arrays support in CSH is appalling, something like associative arrays would have helped me do this so much easier. Anyway, I want to hold some details extracted from the program and then at the... (0 Replies)
Discussion started by: ragabonds
0 Replies

7. Shell Programming and Scripting

Embedding a command with SSH

Hi I am trying to run a script centrally that will go out and set the network management ip address on all my Sun boxes running Solaris. We have decided that the network management address will be the boxes main IP address but the first octet as a 172 rather than a 10, so for example ifconfig -a... (2 Replies)
Discussion started by: hcclnoodles
2 Replies

8. Programming

Embedding xnest in C code

I hope I am posting this in the right section. I have c file that is using the motif GUI toolkit to draw widgets and things of that sort. I also have another program that runs with xnest. I need to figure out a way to place that xnest program in my c code so that it exists in the window that the... (4 Replies)
Discussion started by: lesnaubr
4 Replies

9. Shell Programming and Scripting

Embedding Perl construct in ksh...

Hi, I have an embedded Perl construct in a korn script. However, I cannot seem to access the shell variables that were declared outside this Perl section. This is how my script is written....I have also tried back-ticks where I assign the shell variable to my local perl variable, still... (1 Reply)
Discussion started by: svetlur
1 Replies
Login or Register to Ask a Question
EASTER_DATE(3)								 1							    EASTER_DATE(3)

easter_date - Get Unix timestamp for midnight on Easter of a given year

SYNOPSIS
int easter_date ([int $year = date("Y")]) DESCRIPTION
Returns the Unix timestamp corresponding to midnight on Easter of the given year. Warning This function will generate a warning if the year is outside of the range for Unix timestamps (i.e. before 1970 or after 2037). The date of Easter Day was defined by the Council of Nicaea in AD325 as the Sunday after the first full moon which falls on or after the Spring Equinox. The Equinox is assumed to always fall on 21st March, so the calculation reduces to determining the date of the full moon and the date of the following Sunday. The algorithm used here was introduced around the year 532 by Dionysius Exiguus. Under the Julian Calendar (for years before 1753) a simple 19-year cycle is used to track the phases of the Moon. Under the Gregorian Calendar (for years after 1753 - devised by Clavius and Lilius, and introduced by Pope Gregory XIII in October 1582, and into Britain and its then colonies in September 1752) two correction factors are added to make the cycle more accurate. PARAMETERS
o $year - The year as a number between 1970 an 2037. If omitted, defaults to the current year according to the local time. RETURN VALUES
The easter date as a unix timestamp. EXAMPLES
Example #1 easter_date(3) example <?php echo date("M-d-Y", easter_date(1999)); // Apr-04-1999 echo date("M-d-Y", easter_date(2000)); // Apr-23-2000 echo date("M-d-Y", easter_date(2001)); // Apr-15-2001 ?> NOTES
Note easter_date(3) relies on your system's C library time functions, rather than using PHP's internal date and time functions. As a con- sequence, easter_date(3) uses the TZ environment variable to determine the time zone it should operate in, rather than using PHP's default time zone, which may result in unexpected behaviour when using this function in conjunction with other date functions in PHP. As a workaround, you can use the easter_days(3) with DateTime and DateInterval to calculate the start of Easter in your PHP time zone as follows: <?php function get_easter_datetime($year) { $base = new DateTime("$year-03-21"); $days = easter_days($year); return $base->add(new DateInterval("P{$days}D")); } foreach (range(2012, 2015) as $year) { printf("Easter in %d is on %s ", $year, get_easter_datetime($year)->format('F j')); } ?> The above example will output: Easter in 2012 is on April 8 Easter in 2013 is on March 31 Easter in 2014 is on April 20 Easter in 2015 is on April 5 SEE ALSO
easter_days(3) for calculating Easter before 1970 or after 2037 . PHP Documentation Group EASTER_DATE(3)