jeremyBass26
asked on
Trying to split?
Hello, So I have this that I'm trying to come back to... it's an old question that no one was "able" to answer for me...
I have two things
{emps_grd:{row|0,employer| asdfasdf,a ddress|asd fasdf,phon e|asdf,sup ervisor|as df,contact |false,wag e|,duties| ,from|Mon Jun 2 00:00:00 GMT-0700 2008,to|,reason|},{row|1,e mployer|ne w Employee,address|asdfasdf, phone|,sup ervisor|as dfadf,cont act|false, wage|asdfa sdf,duties |,from|Tue Jun 3 00:00:00 GMT-0700 2008,to|Thu Jun 19 00:00:00 GMT-0700 2008,reason|}}
{jobs_picks:{Job_Pick`0|CN A - MEDICAL UNIT},{Job_Pick`1|Unit Secretary / CNA Mental Health Center},{Job_Pick`2|CREDIT COUNSELOR},{Job_Pick`3|UNI T SECRETARY - ICU/PCU},{Job_Pick`4|CNA - SURGICAL UNIT},{Job_Pick`5|CNA - SURGICAL UNIT}}
each need to be ???split???
the out put I'm looking for is
CNA - MEDICAL UNIT<br/>
Unit Secretary / CNA Mental Health <br/>
etc...
for the job picks
(I'm betting this is more straight forward, I just have not getting it to work yet)
and
employer : asdfasdf<br/>
address : asdfasdf<br/>
phone :asdf<br/>
supervisor : asdf<br/>
contact : false<br/>
wage :<br/>
duties :<br/>
from : Mon Jun 2 00:00:00 GMT-0700 2008<br/>
to :<br/>
reason : <br/>
the plan is to then take the empsgrd and make reason into Reason etc...
it's going into an area like this
<tr>
<td><?= $m9feu_input__APPz_emps_gr d;?>
<span>(1) Employer and Address
<br/>Job Title and Duties </span></td>
<td><span>Dates of Employment
<br/>From To
<br/>Final Salary $ </span></td>
<td><span>Name of Supervisor Phone # May we contact? <br/>Yes______ No ______ Reason for Leaving </span><br/></td>
</tr>
so I'm thinking that if i ??split it then I can run it through a loop and output <tr> after <tr> until there are no more "rows" left....
I hope that makes sense... Please If it does not please let me know I'll try to clear the air...
I'm open to any ideas... but this is one of those questions I need examples of working models and the how it works... As I really don't get the key things or well here is the old question...
https://www.experts-exchange.com/questions/23531863/make-HTML-tables-out-of-a-complexe-array.html
Should prove I don't get this end of it to well... which is why the examples are needed...
Thank you for the help here... I sure need it on this... Have a great one...
jeremyBass
I have two things
{emps_grd:{row|0,employer|
{jobs_picks:{Job_Pick`0|CN
each need to be ???split???
the out put I'm looking for is
CNA - MEDICAL UNIT<br/>
Unit Secretary / CNA Mental Health <br/>
etc...
for the job picks
(I'm betting this is more straight forward, I just have not getting it to work yet)
and
employer : asdfasdf<br/>
address : asdfasdf<br/>
phone :asdf<br/>
supervisor : asdf<br/>
contact : false<br/>
wage :<br/>
duties :<br/>
from : Mon Jun 2 00:00:00 GMT-0700 2008<br/>
to :<br/>
reason : <br/>
the plan is to then take the empsgrd and make reason into Reason etc...
it's going into an area like this
<tr>
<td><?= $m9feu_input__APPz_emps_gr
<span>(1) Employer and Address
<br/>Job Title and Duties </span></td>
<td><span>Dates of Employment
<br/>From To
<br/>Final Salary $ </span></td>
<td><span>Name of Supervisor Phone # May we contact? <br/>Yes______ No ______ Reason for Leaving </span><br/></td>
</tr>
so I'm thinking that if i ??split it then I can run it through a loop and output <tr> after <tr> until there are no more "rows" left....
I hope that makes sense... Please If it does not please let me know I'll try to clear the air...
I'm open to any ideas... but this is one of those questions I need examples of working models and the how it works... As I really don't get the key things or well here is the old question...
https://www.experts-exchange.com/questions/23531863/make-HTML-tables-out-of-a-complexe-array.html
Should prove I don't get this end of it to well... which is why the examples are needed...
Thank you for the help here... I sure need it on this... Have a great one...
jeremyBass
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Actually it depends upon your choice and the project spec. I thought this one will be easier. Other coder may find spliting or any other approaches are easier than my one. Depends on the view of coder.
ASKER
got ya... I'll try it out and get back... thanks for the help here...
jeremyBass
jeremyBass
ASKER
So I think it's all good but I can't fully tell....so could you please show me how to fix this part so I can fix the other...
this is what i did
$data = $m9feu_input__APPz_jobs_pi cks;
if(preg_match_all('/\|(.*? )\}/', $data, $match)){
$match = $match[1];
foreach($match as $str){
$dataOUT = $str . "<br/>\n";
}
}
<?= $dataOUT?>
but all I'm getting out is the very last one... I'm I missing sonthing here? Thanks for the help on this...
jeremyBass
the area of the script
this is what i did
$data = $m9feu_input__APPz_jobs_pi
if(preg_match_all('/\|(.*?
$match = $match[1];
foreach($match as $str){
$dataOUT = $str . "<br/>\n";
}
}
<?= $dataOUT?>
but all I'm getting out is the very last one... I'm I missing sonthing here? Thanks for the help on this...
jeremyBass
the area of the script
$data = $m9feu_input__APPz_jobs_picks;
if(preg_match_all('/\|(.*?)\}/', $data, $match)){
$match = $match[1];
foreach($match as $str){
$dataOUT = $str . "<br/>\n";
}
}
ob_start();
?>
<html>
<head>
<style type="text/css">
</style>
</head>
<body>
<div>
<h1><span>APPLICATION FOR EMPLOYMENT </span></h1><span><span>Date of Application </span><? echo 'Now: '. date('Y-m-d, H:i') ."\n"; ?></span><br/>
<div>
<table>
<tr>
<th> <span>Indicate Position(s) Desired </span><br/><br/><?= $dataOUT?><span> </span></th>
ASKER
Ok so I figured out how to echo it out to the pdf...
problem though...
$m9feu_input__APPz_emps_gr d = "{row|0,employer|Employer 3,address|sdf,phone|,super visor|,con tact|,wage |,duties|, from|,to|, reason|},{ row|1,empl oyer|Emplo yer 2,address|,phone|,supervis or|,contac t|,wage|,d uties|,fro m|,to|,rea son|},{row |2,employe r|Contact, address|,p hone|,supe rvisor|,co ntact|,wag e|,duties| ,from|qwqw qw,to|rere rerer,reas on|xcvxcv} ";
$dataEMPS = $m9feu_input__APPz_emps_gr d;
<? if(preg_match_all('/\{row\ |\d+,(.*?) \}/', $dataEMPS, $match)){
$match = $match[1];
foreach($match as $str){
$str = preg_replace('/\|/', ":", $str);
$str = preg_replace('/,/', "<br/>\n", $str);
echo " $str \n";
}
}?>
that just outputs nothing I think... well it's blank... any ideas?... thanks for the help here...
jeremyBass
problem though...
$m9feu_input__APPz_emps_gr
$dataEMPS = $m9feu_input__APPz_emps_gr
<? if(preg_match_all('/\{row\
$match = $match[1];
foreach($match as $str){
$str = preg_replace('/\|/', ":", $str);
$str = preg_replace('/,/', "<br/>\n", $str);
echo " $str \n";
}
}?>
that just outputs nothing I think... well it's blank... any ideas?... thanks for the help here...
jeremyBass
ASKER
:) so I fixed it... it was a line error above all this so that's why the issue... you were spot on... thanks for the hhelp here ... have a great one today...
jeremyBass
jeremyBass
ASKER
:) so I fixed it... it was a line error above all this so that's why the issue... you were spot on... thanks for the help here ... have a great one today...
jeremyBass
jeremyBass
ASKER
Thanks again
jeremyBass